lengthen space for getty/window commands (70->200)
[unix-history] / usr / src / old / init / init.8
CommitLineData
b891f6cd
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
7f53c63b 5.\" @(#)init.8 6.1 (Berkeley) %G%
b891f6cd 6.\"
7f53c63b 7.TH INIT 8 ""
b891f6cd
KM
8.UC 4
9.SH NAME
10init \- process control initialization
11.SH SYNOPSIS
12.B /etc/init
13.SH DESCRIPTION
14.I Init
15is invoked inside UNIX as the last step in the boot procedure.
16It normally then runs the automatic reboot sequence as described in
17.IR reboot (8),
18and if this succeeds, begins multi-user operation.
19If the reboot fails, it commences single user operation by giving
20the super-user a shell on the console. It is possible to pass parameters
21from the boot program to
22.I init
23so that single user operation is commenced immediately.
24When such single user operation is terminated by killing the single-user
25shell (i.e. by hitting ^D),
26.I init
27runs
28.I /etc/rc
29without the reboot parameter.
30This command file
31performs housekeeping operations
32such as removing temporary files,
33mounting file systems, and starting
34daemons.
35.PP
36In multi-user operation,
37.I init's
38role is to create a process for each
39terminal port on which a user may log in.
40To begin such operations, it reads the file
41.I /etc/ttys
42and
7f53c63b
KM
43executes a command for each terminal specified in the file.
44This command will usually be
45.IR /etc/getty .
b891f6cd
KM
46.I Getty
47reads the user's name and invokes
48.I login
49to log in the user and execute the Shell.
50.PP
51Ultimately the Shell will terminate
52because of an end-of-file either
53typed explicitly or generated as a result of hanging up.
54The main path of
55.IR init ,
56which has been waiting
57for such an event,
58wakes up and removes the appropriate entry from the
59file
60.IR utmp ,
61which records current users, and
62makes an entry in
63.IR /usr/adm/wtmp ,
64which maintains a history
65of logins and logouts.
66The
67.I wtmp
68entry is made only if a user logged in successfully on the line.
69Then the appropriate terminal is reopened and
70.I getty
71is
72reinvoked.
73.PP
74.I Init
75catches the
76.I hangup
77signal (signal SIGHUP) and interprets it to mean that
78the file
79.I /etc/ttys
80should be read again.
81The Shell process on each line which used to be active
82in
83.I ttys
84but is no longer there is terminated;
85a new process is created for each added line;
86lines unchanged in the file are undisturbed.
87Thus it is possible to drop or add phone lines without
88rebooting the system by changing the
89.I ttys
90file and sending a
91.I hangup
92signal to the
93.I init
94process: use `kill \-HUP 1.'
95.PP
96.I Init
97will terminate multi-user operations and resume single-user mode
98if sent a terminate (TERM) signal, i.e. ``kill \-TERM 1''.
99If there are processes outstanding which are deadlocked (due to
100hardware or software failure),
101.I init
102will not wait for them all to die (which might take forever), but
103will time out after 30 seconds and print a warning message.
104.PP
105.I Init
106will cease creating new
107.IR getty 's
108and allow the system to slowly die away, if it is sent a terminal stop (TSTP)
109signal, i.e. ``kill \-TSTP 1''. A later hangup will resume full
110multi-user operations, or a terminate will initiate a single user shell.
111This hook is used by
112.IR reboot (8)
113and
114.IR halt (8).
115.PP
116.I Init's
117role is so critical that if it dies, the system will reboot itself
118automatically.
119If, at bootstrap time, the
120.I init
121process cannot be located, the system will loop in user mode at location
1220x13.
123.SH DIAGNOSTICS
124\fBinit: \fR\fItty\fR\|\fB: cannot open\fR. A terminal which is turned
125on in the \fIrc\fR file cannot be opened, likely because the requisite
126lines are either not configured into the system or the associated device
127was not attached during boot-time system configuration.
128.LP
129\fBWARNING: Something is hung (wont die); ps axl advised\fR. A process
130is hung and could not be killed when the system was shutting down.
131This is usually caused by a process
132which is stuck in a device driver due to a persistent device error condition.
133.SH FILES
f2ba8c7e
KM
134/dev/console,
135/dev/tty*,
136/etc/utmp,
137/usr/adm/wtmp,
138/etc/ttys,
139/etc/rc
b891f6cd 140.SH "SEE ALSO"
f2ba8c7e 141login(1), kill(1), sh(1), ttys(5), crash(8V), getty(8), rc(8), reboot(8),
b891f6cd 142halt(8), shutdown(8)