When you boot the system or change run levels with the init or shutdown command, the init daemon starts processes
by reading information from the /etc/inittab
file. This
file defines these important items for the init process:
That the init process will restart
What processes to start, monitor, and restart if they terminate
What actions to take when the system enters a new run level
Each entry in the /etc/inittab
file has the following
fields:
id
:
rstate
:
action
:
process
The following table describes the fields in an inittab
entry.
Table 14.4. Fields Descriptions for
the inittab
File
Field |
Description |
---|---|
|
Is a unique identifier for the entry. |
|
Lists the run levels to which this entry applies. |
|
Identifies how the process that is specified in the process field is
to be run. Possible values include: For a description of the other action keywords, see inittab ( 4 ) . |
|
Defines the command or script to execute. |
Example 14.2. Default inittab
File
The following example shows a default inittab
file
that is installed with the Solaris release. A description for each line of
output in this example follows.
ap::sysinit:/sbin/autopush -f /etc/iu.ap (1) sp::sysinit:/sbin/soconfig -f /etc/sock2path (2) smf::sysinit:/lib/svc/bin/svc.startd >/dev/msglog 2<>/dev/msglog (3) p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/...(4)
Initializes STREAMS modules
Configures socket transport providers
Initializes the master restarter for SMF
Describes a power fail shutdown
The init
process is started and reads the /etc/default/init
file to set any environment variables. By default,
only the TIMEZONE
variable is set.
Then, init
reads the inittab
file
and does the following:
Executes any process entries that have sysinit
in
the action
field so that any special initializations can
take place before users login.
Passes the startup activities to svc.startd.
For a detailed description of how the init
process
uses the inittab
file, see
init
(
1M
)
.
The following table describes the keywords used for run level 3's action
field.
Table 14.5. Run Level 3 Action Keyword Descriptions
Key Word |
Description |
---|---|
|
Starts the process when the |
|
Starts the process and restarts it when it dies |
|
Starts the process and waits for it to finish before going on to the next entry for this run level |
The following table describes the processes (or commands) that are executed at run level 3.
Table 14.6. Command Descriptions for Run Level 3
Command or Script Name |
Description |
---|---|
/usr/sbin/shutdown |
Shuts down the system. The init process runs the shutdown command only if the system has received a power fail signal. |
/sbin/rcS |
Checks and mounts root ( |
/sbin/rc2 |
Starts the standard system processes and brings the system up into run level 2 (multiuser level). |
/sbin/rc3 |
Starts NFS resource sharing for run level 3. |