Information Technology Reference
In-Depth Information
rootdev
—Sets the physical pathname to the root device
➤
rootfs
—Defines the type of root file system
➤
set
—Sets kernel or module variables
➤
The init Program
The last phase of the boot process is the
init
program. The
init
program is
used to control system processes and services. Its primary purpose is to cre-
ate or stop processes on the basis of the current state of the system. The sys-
tem state is referred to as a
system run level
. Several run levels are defined on
the basis of the type of activities that the system should be supporting while
at a particular run level, such as maintenance, a single user, multiple users,
and so on. Information regarding which processes and services should be
running at a particular run level is stored in the
/etc/inittab
file.
The
init
program also sets the default environment variables as defined in
/etc/default/init
. These include local variables and system parameters
based on location, such as time zone.
The
/etc/inittab
file controls the operation of the
init
program. It defines
which programs to execute at different run levels or other special handling
for processes. The
/etc/inittab
file contains entries that consists of four
fields delimited by the colon (
:
) character. The
/etc/inittab
fields are
defined in Table 2.6.
Table 2.6
The Fields of the /etc/inittab File
Field
Purpose
id
A one- to four-character ID tag used to uniquely identify the entry. The “r”
and “t” characters are reserved and should not be used as the first or only
character of the
id
field.
rstate
The run level (0, 1, 2, 3, 4, 5, 6, or s) associated with this entry. When the
init
program needs to change run level, any process associated with an entry
that has that run level specified in the
rstate
field is executed. Likewise, any
process associated with an entry that does not have that run level specified
in the
rstate
field is sent a
SIGTERM
signal and given five seconds to exit,
and then killed with a
SIGKILL
signal. Three additional values of
rstate
are
supported. These are a, b, and c. Each can be executed independent of the
current run level.
action
A keyword that instructs the
init
program how to treat the process specified
in the
process
field. See Table 2.7 for a description of its keywords.
process
The command to be executed when the
rstate
field matches the current run
level.