Next | Prev | Up | Top | Contents | Index

How init Controls the System State

The init process is the first general process created by the system at startup. It reads the file /etc/inittab, which defines exactly which processes exist for each run level.

In the multiuser state (run level 2), init scans the file for entries that have a tag (also 2) for the run level and executes everything after the third colon on the line containing the tag. For complete information, see the inittab(4) reference page.

The system /etc/inittab looks something like this:

is:2:initdefault: 
fs::sysinit:/etc/bcheckrc </dev/console >/dev/console 2>&1 
mt::sysinit:/etc/brc </dev/console >/dev/console 2>&1 
s0:06s:wait:/etc/rc0 >/dev/console 2>&1 </dev/console
s1:1:wait:/etc/shutdown -y -iS -g0 >/dev/console 2>&1 </dev/console 
s2:23:wait:/etc/rc2 >/dev/console 2>&1 </dev/console 
s3:3:wait:/etc/rc3 >/dev/console 2>&1 </dev/console 
or:06:wait:/etc/umount -ak -b /proc,/debug > /dev/console 2>&1
of:0:wait:/etc/uadmin 2 0 >/dev/console 2>&1 </dev/console 
RB:6:wait:echo "The system is being restarted." >/dev/console 
rb:6:wait:/etc/uadmin 2 1 >/dev/console 2>&1 </dev/console 
# 
This display has been edited for brevity; the actual /etc/inittab file is lengthy. If /etc/inittab is removed by mistake and is missing during shutdown, init enters the single-user state (init s). While entering single-user state, /usr remains mounted, and processes not spawned by init continue to run. Immediately replace /etc/inittab before changing states again. The format of each line in inittab is:

id:level:action:process

where:

When changing levels, init kills all processes not specified for that level.


Next | Prev | Up | Top | Contents | Index