previous contents up next

Unix for Advanced Users

9. The Unix Boot Sequence

9.6. System Startup Scripts

Whenever the system transitions _to_ or _from_ a particular run level, scripts in a certain system directory are fired up. Under SVR4 convention, these directories usually live under /etc (under Linux, they are in /etc/rc.d) and are are named rcN.d where N is the run level. In each startup directory, you will find scripts with names like S10network and K30sendmail. Here is a directory listing for /etc/rc.d/rc3.d under Linux RedHat 6.0 (remember, run level 3 is the multiuser mode in Linux):
./              K20rwalld@     K50snmpd@     S11portmap@   S80sendmail@
../             K20rwhod@      K55routed@    S20random@    S85gpm@
K05innd@        K25squid@      K60mars-nwe@  S30syslog@    S90xfs@
K08autofs@      K28amd@        K75gated@     S40atd@       S93sshd@
K15httpd@       K30mcserv@     K80nscd@      S40crond@     S99linuxconf@
K15postgresql@  K34yppasswdd@  K85netfs@     S50inet@      S99local@
K15sound@       K35dhcpd@      K88ypserv@    S55xntpd@
K20bootparamd@  K35smb@        K96pcmcia@    S60lpd@
K20rstatd@      K45arpwatch@   S05apmd@      S60nfs@
K20rusersd@     K45named@      S10network@   S75keytable@

When the system enters a given run level, scripts in the startup directory corresponding to that run level which start with the letter "K" are fired up with the argument "stop". The order in which they are started is determined by the number after the letter "K" and before the identifier (such as "httpd" in the example above). The scripts starting with "S" are then fired up with the argument "start", again in the numerical order like for the "K" scripts.

previous contents up next