rc[0-6] and inittab
I have come up with the thought that initlevel and rc scripts have something to do with each other, after I had read the chkconfig manual and some other stuff. Is this true, that when i set the inittab runlevel to level X, the respective rc script is executed?
Runlevels are used to indicate which mode the system should be run in. The modes defined are:
0 - Halt
1 - Unknown
2 - Single user
3 - Multi user
4 - unknown
5 - Multi user + X
6 - reboot
so if you did something like telinit 6 as root, your system will reboot.
As for running the scripts in rc[0-6] directory, those are run as initialization and de-initialization routines. When you're shutting down, you need to make sure you unmount the filesystems, properly close the logs, etc.. Also, there may be programs you want to run in one mode that you don't want to run in another.
Look at the files labeled S[0-99]somescript and K[0-99]somescript. All the S scripts are invoked with the word 'start' if they're not already running, and all the K scripts are invoked with the word 'stop' if they're already running. The numbers serve to indicate which order things should be started in.
Hope this helps,
|All times are GMT -5. The time now is 08:13 PM.|