/etc/inittab File

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:

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

id

Is a unique identifier for the entry.

rstate

Lists the run levels to which this entry applies.

action

Identifies how the process that is specified in the process field is to be run. Possible values include: sysinit, boot, bootwait, wait, and respawn.

For a description of the other action keywords, see inittab ( 4 ) .

process

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)
  1. Initializes STREAMS modules

  2. Configures socket transport providers

  3. Initializes the master restarter for SMF

  4. Describes a power fail shutdown

What Happens When the System Is Brought to Run Level 3

  1. 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.

  2. Then, init reads the inittab file and does the following:

    1. Executes any process entries that have sysinit in the action field so that any special initializations can take place before users login.

    2. 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

powerfail

Starts the process when the init process receives a power failure signal

respawn

Starts the process and restarts it when it dies

wait

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 (/), /usr, /tmp, /var, /var/adm, and /var/run file systems.

/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.