|
楼主 |
发表于 2005-4-5 16:23:59
|
显示全部楼层
Question 5.0 : Is it possible to launch eciadsl-start at boot time?
Answer : Yes it is, using init.d for instance, or /etc/ppp/ppp_on_boot for Debian
users.
Making it possible using init.d:
Pre-requisites:
- ECIADSL driver installed and configured
- the ECIADSL sources package, available at:
http://eciadsl.flashtux.org/download.php?lang=en
Copy the rc.adsl file to /etc/init.d:
> cp rc.adsl /etc/init.d
> chmod +x /etc/init.d/rc.adsl
(the rc.adsl file is provided with version >= 0.7 (or CVS))
For Debian, just type as root: update-rc.d rc.adsl defaults 15
For other distributions, see below :
In /etc/rc.d, each rc*.d directory corresponds to an init's runlevel. For
instance, runlevel 5 is the one that leads to a graphical login (this is
default on most Linux systems, but sometimes it's 3), so /etc/rc.d/rc5.d
belongs to that level.
You will find more information about init levels:
> man inittab
or look at your /etc/inittab file.
To know which default init level is reached at boot, find a line like the
following in /etc/inittab file:
id:5:initdefault:
Here, default level is 5.
For the operations below, let's say we use init level 5 at boot.
You have to know that when your system enters an init level, it calls all
the K* files from the last level, then call all the S* files from the new
level. All these K* and S* files are in /etc/rc.d/rc<init level>.d they
belong to.
In fact, these S* and K* files are symlink, and point to scripts located
(most of the times) in /etc/init.d.
Eash S* file is like this: Sxxyyyyy, where xx is a 2-digit number, and
yyyyy a service name (the name is human friendly, but you can set it as
anything you want).
All Sxxyyyyy files are called following the xx number (increasingly), then
by the service name (yyyyy, alphabetical increasing order).
For instance:
> ls /etc/rc.d/rc5.d
shows
S01foo
S15bar
S99dummy
K10makemyday
K80whatthefuck
(take care, it's only an example).
So when init level 5 in entered, it will call S01foo, S15bar then S99dummy.
When init level 5 is left, this is the same for K* files. But following the
system, they are called in the same order (by xx increasingly), or in a
reverse order (by xx decreasingly).
Now you know how all this stuff works, you can make the relevant links to
/etc/init.d in /etc/rc.d/rc5.d:
> ln -s /etc/init.d/rc.adsl /etc/rc.d/rc5.d/S90adsl
> ln -s /etc/init.d/rc.adsl /etc/rc.d/rc5.d/K90adsl
Before you create these links, ensure that the S90 is relevant, this means
that S90* will be called after all other network services.
Of course, verify that K90 is relevant too. According to some systems
(reverse kill order) this would be better to use K00, but simply think of
the best order to kill the connection.
Once all the symlinks are done, you can test it by rebooting your system.
You can also test it without rebooting: close your X11 session, open a
root session in console mode, then:
> init 3
then
> init 5
Understood what it does? It means leaving init level 5 to init level 3, then
coming back to init level 5. The relevant S* and K* links will be called! |
|