Web and email hosting - System Start-up and Shutdown During system start-up, a

System Start-up and Shutdown During system start-up, a series of scripts are run to start the services that you need. These include scripts to start network interfaces, mount directories, and monitor your system. Most of these scripts are run from subdirectories of /etc/rc.d. The program that starts most of these services up when you boot and stops them when you shut down is the /etc/rc.d/rc script. The following sections describe run-level scripts and what you can do with them. Starting run-level scripts As previously mentioned, the /etc/rc.d/rc script is a script that is integral to the concept of run levels. Any change of run level causes the script to be executed, with the new run level as an argument. This simple yet powerful script is shown and discussed here: #!/bin/bash # # rc This file is responsible for starting/stopping # services when the runlevel changes. It is also # responsible for the very first setup of basic # things, such as setting the hostname. # # Original Author: # Miquel van Smoorenburg, # # Now find out what the current and what the previous runlevel are. argv1=”$1″ set `/sbin/runlevel` runlevel=$2 previous=$1 export runlevel previous # Source function library. . /etc/init.d/functions # See if we want to be in user confirmation mode if [ “$previous” = “N” ]; then if grep -i confirm /proc/cmdline >/dev/null || [ -f /var/run/confirm ] ; then rm -f /var/run/confirm CONFIRM=yes else CONFIRM= echo “Entering non-interactive startup” fi fi export CONFIRM # Get first argument. Set new runlevel to this argument. [ “$1″ != “” ] && runlevel=”$argv1″ # Tell linuxconf what runlevel we are in [ -d /var/run ] && echo “/etcrc$runlevel.d” > /var/run/runlevel.dir # Is there an rc directory for this new runlevel? if [ -d /etc/rc$runlevel.d ]; then # First, run the KILL scripts. for i in /etc/rc$runlevel.d/K*; do # Check if the script is there. [ ! -f $i ] && continue
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Leave a Reply