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