Run Control Scripts
The UNIX system gives runcontrol (rc) scripts which help to modify the run level. This modification involves
1. Mounting and Checking file systems.
2. Starting or stopping processes like as print daemons, A NFS client server daemons.
3. Performing housekeeping tasks.
The runcontrol scripts situated in the /etc/rc.d directory direct the system to read script files in the associated run level directories located in /etc/rc.d/rc#.d. For instance, the /etc/rc.d/rc script would read the files located in the /etc/rc.d/rc2.d directory. The /etc/rc.d/rc#.d directories hold a script which begins and stop system services. Files which start with S are used to begin processes. Files which begin with K are used to kill processes. These files are run in alphanumeric sequences. The series order is determined through
Uppercase S(0-9) (A-Z,a-z,0-9)Uppercase K(0-9)(A-Z,a-z,0-9)
File name begin with lowercase letters will not run
Note: For run a startup file, the filename has to be adding in sequential order with "S" as a prefix to the filename.
Practice 7.1
The given program displays how to write a run control script
# cd /etc/rc.d/rc3.d
# cat > S100sample
echo echo
echo "************************"
echo "THESE IS A DEMO FOR RUNCONTROL SCRIPTS"
echo " DEFAULT RUN LEVEL "
echo "************************"
echo echo echo
# init 6
***************************************
THESE IS A DEMO FOR RUNCONTROL SCRIPTS DEFAULT RUN LEVEL
***************************************
The given procedure will echo the message to denote the DEFAULT RUN LEVEL" that is kept in /etc/rc.d/rc3.d. In the directory the default run level is 3 and whenever init 6(reboot) is provide the updation will be done to the system and the suitable process will be invoked.