Research V7 development
[unix-history] / usr / man / man8 / init.8
CommitLineData
bc54062d
KT
1.TH INIT 8
2.SH NAME
3init, rc \- process control initialization
4.SH SYNOPSIS
5.B /etc/init
6.br
7.B /etc/rc
8.SH DESCRIPTION
9.I Init
10is invoked as the last step of the boot procedure (see
11.IR boot (8)).
12Generally its role is to create a process for each
13typewriter on which a user may log in.
14.PP
15When
16.I init
17first is executed
18the console typewriter
19.I /dev/console.
20is opened for reading
21and writing and the shell is invoked immediately.
22This feature is used to bring up a single-user system.
23If the shell terminates,
24.I init
25comes up multi-user and the process described below is started.
26.PP
27When
28.I init
29comes up multiuser,
30it
31invokes a shell, with input taken from the
32file
33.I /etc/rc.
34This command file
35performs housekeeping
36like removing temporary files,
37mounting file systems, and starting
38daemons.
39.PP
40Then
41.I init
42reads the file
43.I /etc/ttys
44and
45forks several times to create a process
46for each typewriter specified in the file.
47Each of these processes opens the appropriate typewriter
48for reading and writing. These channels thus
49receive file descriptors 0, 1 and 2, the standard input,
50output and error files.
51Opening the typewriter will usually involve a delay,
52since the
53.IR open ""
54is not completed until someone
55is dialed up and carrier established on the channel.
56Then
57.I /etc/getty
58is called with argument as specified by the last character of
59the
60.I ttys
61file line.
62.I Getty
63reads the user's name and invokes
64.IR login (1)
65to log in the user and execute the shell.
66.PP
67Ultimately the shell will terminate
68because of an end-of-file either
69typed explicitly or generated as a result of hanging up.
70The main path of
71.IR init ,
72which has been waiting
73for such an event,
74wakes up and removes the appropriate entry from the
75file
76.IR utmp ,
77which records current users, and
78makes an entry in
79.IR /usr/adm/wtmp ,
80which maintains a history
81of logins and logouts.
82Then the appropriate typewriter is reopened and
83.I getty
84is
85reinvoked.
86.PP
87.I Init
88catches the
89hangup signal SIGHUP and interprets it to mean that
90the
91system should be brought from multi user to single
92user.
93Use `kill -1 1' to send the hangup signal.
94.SH FILES
95/dev/tty?, /etc/utmp, /usr/adm/wtmp, /etc/ttys, /etc/rc
96.SH "SEE ALSO"
97login(1), kill(1), sh(1), ttys(5), getty(8)