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 18–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. |
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).