INIT(1M) SysV INIT(1M)
NAME
init - process control initialization
SYNOPSIS
/etc/init
DESCRIPTION
init is invoked as the last step in the boot procedure. It normally runs
the automatic reboot sequence, and if this succeeds, begins multi-user
operation.
In multi-user operation, init's role is to create a process for each
terminal port on which a user may log in. To begin such operations, it
reads the file /etc/ttys and executes a command for each terminal
specified in the file. This command will usually be /etc/getty. getty
opens and initializes the terminal line, reads the user's name and
invokes login to log in the user and execute the shell.
Ultimately the shell will terminate because of an end-of-file either
typed explicitly or generated as a result of hanging up. The main path
of init, which has been waiting for such an event, wakes up and removes
the appropriate entry from the file utmp, which records current users,
and makes an entry in /usr/adm/wtmp, which maintains a history of logins
and logouts. The wtmp entry is made only if a user logged in
successfully on the line. Then the appropriate terminal is reopened and
getty is reinvoked.
init catches the hangup signal and interprets it to mean that the file
/etc/ttys should be read again. The shell process on each line which
used to be active in ttys but is no longer there is terminated; a new
process is created for each added line; lines unchanged in the file are
undisturbed. Thus it is possible to drop or add terminal lines without
rebooting the system by changing the ttys file and sending a hangup
signal to the init process: use kill -1 1.
init will terminate multi-user operations and resume single-user mode if
sent a terminate signal. If there are processes outstanding which are
deadlocked (due to hardware or software failure), init will not wait for
them all to die (which might take forever), but will time out after 30
seconds and print a warning message.
init will cease creating new getty's and allow the system to slowly die
away, if it is sent a terminal stop signal. A later hangup will resume
full multi-user operations, or a terminate will initiate a single user
shell.
init's role is so critical that if it dies, the system will reboot itself
automatically.
DIAGNOSTICS
/etc/getty gettyargs failing, sleeping.
A process being started to service a line is exiting quickly each time it
is started. This is often caused by a ringing or noisy terminal line.
init will sleep for 30 seconds, then continue trying to start the
process.
FILES
/dev/console
/dev/tty*
/etc/utmp
/usr/adm/wtmp
/etc/ttys
/etc/rc
SEE ALSO
login(1), kill(1), sh(1), getty(1m), rc(1m), shutdown(1m)