There are seven runlevels numbered 0 through 6, five of which have fairly well-defined uses:
On our system, runlevels 3 through 5 are identical and runlevel 2 does not include networking or gpm.
The services which are run for each runlevel are specified in directories /etc/rc.d/rc#.d/, where "#" is the runlevel. The "files" in the runlevel directory are symbolic links to scripts in /etc/rc.d/init.d. The names are of the form "Snndaemon" or "Knndaemon", where S means start this daemon in this runlevel, and K means kill this daemon before starting this runlevel, and nn is a number used to order the kills and starts. When a runlevel is started, the kill scripts are run in alphabetical order, and then the start scripts are run, also in alphabetical order.
When booting, init first runs the scripts in /etc/rc.d/rcsysinit.d. For our system, these:
init then runs the scripts for the specific runlevel as described above. For instance, in runlevel 3, they:
The above init strategy makes it particularly easy to restart services: one simply re-runs the script. For example, to change the IP address, the system administrator need only modify the correct configuration files and run "/etc/rc.d/init.d/network restart". Rebooting should never be necessary, except if a different kernel needs to be run, an extremely rare kernel panic occurs, or a power failure occurs.
System administrators often put all of their local modifications in a single script, which is usually run just before init starts the agetty processes. To do this, one could create the script /etc/rc.d/init.d/local and then link it to the appropriate run level directories using, for instance, "ln -s /etc/rc.d/init.d/local /etc/rc.d/rc3.d/S99local". If you really want lpr to be started before the local script, simply rename its link to S98lprng using the mv command.
Windows uses the "registry" to hold configuration information, but it is nearly impossible to modify it in a "safe" way other than through control panels which do much to hide the workings of the system from the curious. Registry failure is generally a catastrophic event, while text file failure only affects the particular file involved.
When booting from the CD-ROM, our system interactively configured the following files:
(your host's IP address) (your host's full domain name) (your host's alias)
127.0.0.1 localhost
nameserver (your DNS server's IP address)
HOSTNAME=(your host's full domain name)Notice that the contents of this file (as well as the one following and many other configuration files in a UNIX environment) resemble shell commands used to set environment variables; that is exactly what they are (they are included in startup scripts at run time);
GATEWAY=(your gateway's IP address)
GATEWAY_IF=eth0
SERVICE=static
IP=(the IP address for eth0)
NETMASK=(the network mask for eth0)
BROADCAST=(the broadcast address for eth0)
ONBOOT=yes
The option "user" indicates that an ordinary user (not root) can mount disks on the device (see mount options). In order to make use of this, you will want to create the directory /media/flash, and link /dev/flash to /dev/sdb1 with "ln -s /dev/sdb1 /dev/flash". By using a symbolic link in fstab instead of a specific device, changes in hardware configuration will not require another change in fstab; simply delete the old /dev/flash link and make a new one as appropriate.
/dev/flash /media/flash vfat noauto,user 0 0
If you routinely use more than one flash drive, you may want to handle this a little differently. The best approach is to run udev, which dynamically creates and destroys device files as needed. Since we aren't running udev in the lab yet, another approach is to make a series of fstab entries, mount points and links as above, linking /dev/flash2 to /dev/sdc1, etc.
©2005, Kenneth R. Koehler. All Rights Reserved. This document may be freely reproduced provided that this copyright notice is included.
Please send comments or suggestions to the author.