28.4. Now for the run levels

One of the last tasks init does before the system ‘comes up’ is to run all the scripts for the default run level. The file that does this calling is either /etc/rc.d/rc or /etc/rc.init. The role of this script is to first kill processes for that level then start processes for that level.

But how does it know what services to start or stop? The rc or rc.init file will do a kind of for loop executing each rc.script that starts with a K in the rc3.d directory and passing it a parameter of ‘stop’. It will then carry out the same process for all rc.scripts starting with an S and passing it a parameter of ‘start’. Indeed the same process is carried out when a run level change is invoked but, instead of rc3.d, it will process ...

Get Linux and Unix Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.