init(8) — Maintenance
OSF
NAME
init − Process control initialization
SYNOPSIS
init [0s23]
DESCRIPTION
The init program initializes the system by creating and controlling processes. The processes run by init at each run level are defined in the inittab file. init reads entries contained within the inittab file and acts on them.
The init command considers the system to be in a run level at any given time; each run level has a specific group of processes that run at that level. init operates in one of four run levels: 0, s, 2, or 3. The run level changes when a privileged user invokes init. The new init sends appropriate signals to the original init that tell it which run level to change to.
The init command is run as the last step of the boot process after the root file system is mounted. init attempts to locate the inittab file and looks for an entry with the initdefault keyword. If the entry is there, init uses the run level specified as the initial run level to enter. If the entry is not in the inittab file, or the inittab file is not found, init requests that the user enter a run level from the system console, /dev/console. If the user enters the letter s, init enters single user state, assigns the virtual console terminal to the user’s terminal and opens it for reading and writing. The su command is invoked and the system displays a message on the console stating the location of the virtual console.
To change the run level, the user enters one of the digits 0, 2, or 3, or the letter s.
0shuts down and halts the system.
schanges the run level to a single user state with only the essential kernel services.
2changes the run level to a multiuser state with local processes and daemons.
3changes the run level to a multiuser state with remote processes and daemons.
If this is the first post-boot execution of init to a run level other than single user, it searches the inittab file for entries at the new run level that have the boot or bootwait keywords. init acts on these entries before processing other entries in the inittab file if the run level entered matches the entry. Any special initialization
of the system, such as checking and mounting file systems, takes place before users are allowed on the system. init then scans the inittab file to find all entries that are to be handled for that level.
Before starting a new process, init reads each entry in the inittab file, and for each entry that should be respawned, init forks a child process. After spawning all required processes, init waits for one of its descendant processes to stop, a power-fail signal, or a signal that it should change the run level. When one of the preceding three conditions occurs, init reexamines the inittab file. You can add new entries to the inittab file by editing the file but init does not reexamine the file until one of the three conditions actually occurs. To provide for immediate reexamination of the file, run the init -q command.
FILES
/sbin/initSpecifies the command path
/tcb/files/inittab
Specifies the init command control file
tcb/files/sysinitrc
Specifies the boot time script used by systems that do not support inittab
/var/adm/wtmp
Specifies the permanent login accounting file
RELATED INFORMATION
Commands: getty(8), rc0(8), rc2(8), rc3(8), shutdown(8)
Files: inittab(4)