June 2017
Intermediate to advanced
478 pages
13h 14m
English
Each component that needs to respond to a runlevel change has a script in /etc/init.d to perform the change. The script should expect two parameters: start and stop. I will give an example of this later.
The runlevel handling script, /etc/init.d/rc, takes the runlevel it is switching to as a parameter. For each runlevel, there is a directory named rc<runlevel>.d:
# ls -d /etc/rc* /etc/rc0.d /etc/rc2.d /etc/rc4.d /etc/rc6.d /etc/rc1.d /etc/rc3.d /etc/rc5.d /etc/rcS.d
There you will find a set of scripts beginning with a capital S followed by two digits, and you may also find scripts beginning with a capital K. These are the start and kill scripts. Here is an example of the scripts for runlevel 5:
# ls /etc/rc5.d S01networking ...
Read now
Unlock full access