INIT(8)

NAME
init - start and kill processes

DESCRIPTION
init is the component of the UNIX operating system that is responsible for creating processes once the system has finished booting and for maintaining those processes, including killing them.

At any time, the system is in one of 12 states or run levels. At each run level, a different group of processes is allowed to run. Generally, when the run level changes, init kills the processes which it created under the old run level, and creates a new set for the new run level.

Run levels are identified with single characters in the set [bs0123456789]. B and S are also accepted as equivalents to b and s. Some of these run levels have special meaning and are listed below. Except for b, all run levels can have their meaning changed via runl commands in /etc/inittab.

Except for levels 0, 5 and 6, the actual state of the machine after init switches to a level is completely defined by the processes which run, which are configurable in /etc/inittab. It is therefore possible to use all but those three run levels for purposes other than their intended one. Their meaning as described here are the conventional meaning. It is encouraged that the conventions be followed.

b (boot)
    This is the run level that is selected by default. Any initialization processes should be run under this level. By default, init switches to run level s (single user) after starting processes at this level. The bootlevel command in /etc/rchost may be used to modify this behavior.

0   This is the system shutdown level. Switching to this level will cause the system to shut down after any level 0 processes have been run.

1   This run level is defined as the administration state.

2, 3, 4
    These are multi user run levels. Level 2 is standard. Level 3 is multi user with networking, and level 4 is an alternate multi user set up.

5   Under UNIX, this is the firmware monitor run level. Under GNO, switching to this level causes GNO to quit. The disparity arises from the fact that there is no such thing as quitting UNIX.

6   Switching to this level causes the system to reboot.

s   This is the single user run level.

7, 8
    These are local run levels. Any local terminals are active, as well as any local area networks (level 8), but no dialups are active and no modem based networking is available.

9   This level is undefined.

SIGNALS
The following signals can be sent to init to force certain conditions. Note that these are intended as low level commands; init(1) should be used to issue these signals.

SIGHUP
    Causes init to reread /etc/inittab, kill processes that have been removed from it, and start processes that were newly added.

    init depends on the process names (see inittab(5)) to compare the old copy of the table with the new one.

SIGTERM
    Causes init to switch to the kill default run level. This is 0 unless it is changed in /etc/inittab. Normally, the effect is a system shutdown.

SIGUSR1
    Causes init to try to receive a message (see procrecv(2)) and act on it. The message is typically sent by init(1) and contains status inquiries or run level change requests.

SIGUSR2
    Causes init to exit its sigpause(2) and check for any pending events (which is useful if a timing bug has caused init to go to sleep while it had pending events).

NOTES
Under real UNIX, there are fewer run levels.

When switching to some run levels, init automatically issues a runl command to carry out the apropriate action for that run level. This action can be overridden with another runl command, possibly n to cancel any special action at all.

If init becomes idle and has no children, it switch to the idle run level, which is 5 by default.

If a LOG_EMERG message is received by syslogd(8), init will switch to the panic run level, 6 by default.

When a child of init dies, any entry it has in the utmp(5) database will be removed before any other action is taken. Also, stray bogus entries are removed whenever they are noticed.

At startup time, init tries to read the file /etc/rchost and set certain system globals according to the information in that file.

FILES
/etc/inittab
/usr/sbin/initd
/var/adm/utmp
/var/adm/wtmp
/etc/rchost

SEE ALSO

init(1), inittab(5), rchost(5), utmp(5), getty(8), syslogd(8)

AUTHOR
Phillip Vandry, <vandry@cam.org>