Installation guide
Note
One of the last things the init program executes is the /etc/rc.d/rc.local file. This file is
useful for system customization. Refer to Section 33.3, “ Running Additional Programs at Boot
Time” for more information about using the rc.local file.
After the init command has progressed through the appropriate rc directory for the runlevel, the
/etc/inittab script forks an /sbin/mingetty process for each virtual console (login prompt)
allocated to the runlevel. Runlevels 2 through 5 have all six virtual consoles, while runlevel 1 (single
user mode) has one, and runlevels 0 and 6 have none. The /sbin/mingetty process opens
communication pathways to tty devices , sets their modes, prints the login prompt, accepts the
user's username and password, and initiates the login process.
In runlevel 5, the /etc/inittab runs a script called /etc/X11/prefdm. The prefdm script
executes the preferred X display manager — gdm, kdm, or xdm, depending on the contents of the
/etc/sysconfig/desktop file.
Once finished, the system operates on runlevel 5 and displays a login screen.
33.3. Running Addit ional Programs at Boot Time
The /etc/rc.d/rc.local script is executed by the init command at boot time or when changing
runlevels. Adding commands to the bottom of this script is an easy way to perform necessary tasks
like starting special services or initialize devices without writing complex initialization scripts in the
/etc/rc.d/init.d/ directory and creating symbolic links.
The /etc/rc.serial script is used if serial ports must be setup at boot time. This script runs
setserial commands to configure the system's serial ports. Refer to the setserial man page for
more information.
33.4. SysV Init Runlevels
The SysV init runlevel system provides a standard process for controlling which programs init
launches or halts when initializing a runlevel. SysV init was chosen because it is easier to use and
more flexible than the traditional BSD-style init process.
The configuration files for SysV init are located in the /etc/rc.d/ directory. Within this directory,
are the rc, rc.local, rc.sysinit, and, optionally, the rc.serial scripts as well as the following
directories:
init.d/ rc0.d/ rc1.d/ rc2.d/ rc3.d/ rc4.d/ rc5.d/ rc6.d/
The init.d/ directory contains the scripts used by the /sbin/init command when controlling
services. Each of the numbered directories represent the six runlevels configured by default under
Red Hat Enterprise Linux.
33.4 .1. Runlevels
The idea behind SysV init runlevels revolves around the idea that different systems can be used in
different ways. For example, a server runs more efficiently without the drag on system resources
created by the X Window System. Or there may be times when a system administrator may need to
[14]
[15]
Red Hat Ent erprise Linux 5 Inst allat ion G uide
34 4