unset LANG unset LC_ALL unset TEXTDOMAIN unset TEXTDOMAINDIR (Web site hosting)
unset LANG unset LC_ALL unset TEXTDOMAIN unset TEXTDOMAINDIR exec $i start fi $i start else action “Starting $subsys” $i start fi fi done fi As with the inittab file, lines beginning with a # character are considered comments. Well, almost: The first line indicates that a unique instance of /bin/bash will be run for the execution of the script. The first noncommented lines deal with past, present, and future run levels. The variable argv1 takes on the value of the first (and only) command-line argument ($1). This represents the desired run level. The set command places the output of the runlevel command (explained later in this section) into $1 and $2, which are then distributed to the previous (the previous run level) and runlevel (the current run level) variables. The next line reads /etc/init.d/functions, which contains several segments of shell script code (such as the action, killproc, and confirm subroutines) used to provide a consistent interface for each process started from the rc script. If the confirm option is passed to the boot loader at boot time, no daemons or server processes will start without first being confirmed by a user at the system console. This next block of code checks if processes will need to be confirmed and sets the CONFIRM variable appropriately. In the next line, if the first part evaluates to a true (0) value (the value of $1 does not equal a null string), the second part following the && is run. The run-level variable is set to the desired run level as stored in the variable argv1. In the same manner on the next line, if the directory /var/run exists, the /var/run/runlevel.dir is created or overwritten. This file will contain the name of the directory that contains the commands about to be run (i.e., /etc/rc3.d). The next block begins by checking if that directory exists, terminating if it does not. At this point, the program begins the loop where all scripts in the run-level directory that begin with the letter K (representing those programs that should be stopped in the new run level) are run. Various checks are performed, skipping over such things as broken symbolic links (where the actual file to which the link points no longer exists) and files left around as conflicts when new RPM packages are installed over existing files that had been modified. In the line beginning with subsys=, conditional parameter expansion is performed within the curly braces ({}), removing the regular expression following the # from the variable specified before it. For example, if the value of the variable $i was /etc/rc3.d/K60lpd, the resultant value stored in the variable subsys would be lpd. The rc script will not attempt to kill a daemon if its lock files in the /var/lock/subsys directory do not exist, indicating that the daemon is not running. The next block of code checks whether the script that is about to run contains a reference to the killproc or action procedures as defined in the /etc/init.d/functions file. If such a reference exists, the script is called with stop as a command-line argument. Otherwise, the action procedure is called directly. Using this mechanism ensures that the output on the console is consistent for all daemons that are stopped. At the end of that loop, all daemons that should not be running in the new run level will have been terminated. The next loop similarly cycles through the files in the same directory that begin with the letter S, representing
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.