INIT(8) COMMAND REFERENCE INIT(8)
NAME
init - process control initialization
SYNOPSIS
/etc/init
DESCRIPTION
Init is invoked inside UTek as the last step in the boot
procedure. It normally then runs the automatic reboot
sequence as described in reboot(8), and if this succeeds,
begins multi-user operation. If the reboot fails, it
commences single-user operation by giving the super-user a
shell on the console.
It is possible to pass parameters from the boot program to
init so that single-user operation is commenced immediately.
For the 6200 series, the parameter S will cause this. The
parameter M will cause multi-user operation to begin after
reboot, as described above.
When such single user operation is terminated by killing the
single-user shell (i.e. by hitting ^D), init runs /etc/rc
without the reboot parameter. This command file performs
housekeeping operations such as removing temporary files,
mounting file systems, and starting daemons.
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 forks
several times to create a process for each terminal
specified in the file. Each of these processes opens the
appropriate terminal for reading and writing. These
channels thus receive file descriptors 0, 1 and 2, the
standard input and output and the diagnostic output.
Opening the terminal will usually involve a delay, since the
open is not completed until someone is dialed up and carrier
established on the channel. If a terminal exists but an
error occurs when trying to open the terminal init complains
by writing a message to the system console; the message is
repeated every 10 minutes for each such terminal until the
terminal is shut off in /etc/ttys and init is notified (by a
hangup signal, as described below), or the terminal becomes
accessible (init checks again every minute). After an open
succeeds, /etc/getty is called with argument as specified by
the second character of the ttys file line. Getty 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
Printed 10/17/86 1
INIT(8) COMMAND REFERENCE INIT(8)
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 (signal SIGHUP) 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 phone lines without rebooting the system by changing the
ttys file and sending a hangup signal to the init process:
use `kill -HUP 1.'
Init will terminate multi-user operations and resume
single-user mode if sent a terminate (TERM) signal, i.e.
``kill -TERM 1''. 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 (TSTP)
signal, i.e. ``kill -TSTP 1''. A later hangup will resume
full multi-user operations, or a terminate will initiate a
single user shell. This hook is used by reboot(8) and
halt(8).
FILES
/dev/console
/dev/tty*
/etc/utmp
/usr/adm/wtmp
/etc/ttys
/etc/rc
DIAGNOSTICS
init: tty: cannot open.
A terminal which is turned on in the rc file cannot be
opened, usually because the requisite lines are either
not configured into the system or the associated device
was not attached during boot-time system configuration.
WARNING: Something is hung (won't die); ps -axl advised.
Printed 10/17/86 2
INIT(8) COMMAND REFERENCE INIT(8)
A process is hung and could not be killed when the
system was shutting down. This is usually caused by a
process which is stuck in a device driver due to a
persistent device error condition.
SEE ALSO
kill(1), login(1), sh(1sh), ttys(5), crash(8), getty(8),
halt(8), rc(8), reboot(8), shutdown(8).
Printed 10/17/86 3
%%index%%
na:72,73;
sy:145,127;
de:272,2944;3360,1899;
fi:5259,229;
di:5488,550;6182,229;
se:6411,316;
%%index%%000000000126