# ADSL-START -- Automatic in init.d , startup order...?

## Mustard007

Hi !

I want to set my adsl-start script to start automaticaly in the init.d just after the eth0. I want this to use with automatic internet clock setting, etc...

I know start(){} and stop(){} fonction, what to put in depend() fonction ?

It's the best way to do that ?

It's rp-pppoe.

Thanks !

----------

## cyfred

Hi

All I did to achieve this same thing was make the following file (/etc/init.d/adsl)

```
# /etc/init.d/adsl

#

# Script to initialise the adsl connection

 depend () {

    need net.eth0 # Or whichever device needed for modem

}

start () {

  adsl-start

}

stop () {

  adsl-stop

}

```

Then just add that to your default runlevel

```
rc-update add adsl default
```

 :Smile:   enjoy your adsl connection starting on boot up.

If you run a firewall on boot up aswell then you should add adsl to it's depend section so that all network connections are active for it to work on.[/quote]

----------

## zhenlin

The docs specifically say, if you want to have eth0 for ADSL, you cannot have eth0 as a network connection... Although it does work, so long as the ADSL connection replaces the eth0 gateway.

----------

## Nicom

This may be a stupid question, but is this supposed to happen?

```
bash-2.05b# nano -w /etc/init.d/adsl

bash-2.05b# rc-update add adsl default

 * adsl not executable; skipping

 * Caching service dependencies...                                        [ ok ]

 * rc-update complete.

bash-2.05b# 

```

As for the contents of "/etc/init.d/adsl" , I copied cyfred's example. Is it a simple matter of changing the adsl permissions, and then re-typing "rc-update add adsl default" ?

----------

## rpodgorny

Why don't you just try? :-)

Anyway, I believe it will solve the "problem"... :-)

----------

## Nicom

I suppose I should have just tried it, cause it worked. I just couldn't remember how to work the chmod command, but after looking it up everything is fine now. I'm just so used to gui, it'll take some time to learn all these commands.

----------

## Nicom

Btw I still need help. I managed to get the permisions right that's all. I have added adsl to rc-update and no adsl connections start at boot? What is wrong?

----------

## Sh4doW

if you're sure that your ethX is up & running at boottime and you can do adsl-start as root in console (and it works), simply add line adsl-start in /etc/conf.d/local.start and it "should" work ... at least it works for me.

----------

## Nicom

Thanks! local.start looks pretty handy for an inept scripter like me. Works great now.

----------

