# adsl at boot time

## MOS-FET

hello, i've configured my adsl with adsl-setup and i'm starting it with adsl-start. i also have emerged rp-pppoe. how can i tell gentoo to go online at boot time? is that with rc-config? or can i somehow add the adsl-start script to one of the runlevels?

thanks!

tom

----------

## squiddy

Typically you add networking to your default runlevel with a command as such:

```
rc-update add net.eth0 default
```

This is what you would do if the device name was eth0.  The name after "add" in that command corresponds to the name of the service in /etc/init.d.  So, in order to have sshd start automatically in the default runlevel you would issue this command:

```
rc-update add sshd default
```

Running rc-update with no arguements as root (or with sudo) will describe usage (as any good script should  :Smile: ).

----------

## Spirit

I put 'adsl-start 1>&2' into /etc/conf.d/local.start and 'adsl-stop 1>&2' into /etc/conf.d/local.stop. It starts up at boottime qith 'rc-update add local default'.

----------

## SouthOfHeaven

sweet now i know how i can do it  :Smile:  so far ive been using inittab to start it  :Smile: 

----------

## Woland

Or, you can copy the script below into /etc/init.d/adsl and then run rc-update add adsl default  ( I am asumming you are using roaring penguin.

```

#!/sbin/runscript

# Writen by ME! with _LOTS_ of help from Gentoo Forums.

#depend() {

#     need net

#        }

start () {

        ebegin "Starting ADSL:"

                /usr/sbin/adsl-start

                eend $? "ADSL failed - bugger all!"

}

stop () {

        ebegin "Stopping ADSL:"

                /usr/sbin/adsl-stop

                eend $? "ADSL stopping - FAILED"

}

status () {

         ebegin "Checking ADSL status:"

         /usr/sbin/adsl-status

        eend $?  "You did install rp-ppoe?"

}

```

The depend() function is commented out, because I want ADSL to start no matter how the rest of the network is doing.  You can read more about this function, just search the fora.

----------

## heavy

thanks for that /etc/init.d/adsl script, works great!!

heavy

----------

## mlsfit138

The script worked for me 2!  :Very Happy: 

The first time i tried the script, dsl timed out, so i uncommented the need net function, and the second time around, it worked fine.  no idea why!

----------

## Woland

 *mlsfit138 wrote:*   

> The script worked for me 2! 
> 
> The first time i tried the script, dsl timed out, so i uncommented the need net function, and the second time around, it worked fine.  no idea why!

 

Well, rp-pppoe works best if the interface that it is on is not defined, so if your DSL modem is hooked up to eth0, you should not run "ifconfig up" on that interface prior to rp-pppoe, and afterwards, of course, there is no need to do it, rp-pppoe sets up the interface for you.

I belive that is why I had "need net" commented out in my script.  The only reason you would "need net," is if for some strange reason you needed the rest of your network to be up first.  But logically, you would think, that you would want your ppp-oe up before other networking scrips---say ntpd---'cause otherwise they would be useless.  That is why I have "need net" commented out.

Why your computer is behaving in this strange fassion I do not know.  My only guess would be that without "need net," the adsl scipt runs before the module loader, and so the network card modules are not loaded into the kernel---in that case the script would fail.  I built my NIC drivers into my kernel, so I would not have this problem.

If you feel like it, fugure out the order in which your services are run on your boot up.  That may provide some clue.

----------

