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