1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 | <sect1 id="ch-system-sysvinit" role="wrap">
|
---|
7 | <title>Sysvinit-&sysvinit-version;</title>
|
---|
8 | <?dbhtml filename="sysvinit.html"?>
|
---|
9 |
|
---|
10 | <indexterm zone="ch-system-sysvinit"><primary sortas="a-Sysvinit">Sysvinit</primary></indexterm>
|
---|
11 |
|
---|
12 | <sect2 role="package"><title/>
|
---|
13 | <para>The Sysvinit package contains programs for controlling the startup,
|
---|
14 | running, and shutdown of the system.</para>
|
---|
15 |
|
---|
16 | <segmentedlist>
|
---|
17 | <segtitle>&buildtime;</segtitle>
|
---|
18 | <segtitle>&diskspace;</segtitle>
|
---|
19 | <seglistitem><seg>0.1 SBU</seg><seg>1012 KB</seg></seglistitem>
|
---|
20 | </segmentedlist>
|
---|
21 |
|
---|
22 | <segmentedlist>
|
---|
23 | <segtitle>&dependencies;</segtitle>
|
---|
24 | <seglistitem><seg>Binutils, Coreutils, GCC, Glibc, and Make</seg></seglistitem>
|
---|
25 | </segmentedlist>
|
---|
26 | </sect2>
|
---|
27 |
|
---|
28 | <sect2 role="installation">
|
---|
29 | <title>Installation of Sysvinit</title>
|
---|
30 |
|
---|
31 | <para>When run-levels are changed (for example, when halting the
|
---|
32 | system), <command>init</command> sends termination signals to those
|
---|
33 | processes that <command>init</command> itself started and that should
|
---|
34 | not be running in the new run-level. While doing this,
|
---|
35 | <command>init</command> outputs messages like <quote>Sending processes
|
---|
36 | the TERM signal</quote> which seem to imply that it is sending these
|
---|
37 | signals to all currently running processes. To avoid this
|
---|
38 | misinterpretation, modify the source so that these messages read like
|
---|
39 | <quote>Sending processes started by init the TERM signal</quote>
|
---|
40 | instead:</para>
|
---|
41 |
|
---|
42 | <screen><userinput>sed -i 's@Sending processes@& started by init@g' \
|
---|
43 | src/init.c</userinput></screen>
|
---|
44 |
|
---|
45 | <para>Compile the package:</para>
|
---|
46 |
|
---|
47 | <screen><userinput>make -C src</userinput></screen>
|
---|
48 |
|
---|
49 | <para>Install the package:</para>
|
---|
50 |
|
---|
51 | <screen><userinput>make -C src install</userinput></screen>
|
---|
52 |
|
---|
53 | <beginpage/>
|
---|
54 |
|
---|
55 | </sect2>
|
---|
56 |
|
---|
57 | <sect2 id="conf-sysvinit" role="configuration"><title>Configuring Sysvinit</title>
|
---|
58 | <indexterm zone="conf-sysvinit">
|
---|
59 | <primary sortas="a-Sysvinit">Sysvinit</primary>
|
---|
60 | <secondary>configuring</secondary></indexterm>
|
---|
61 |
|
---|
62 | <indexterm zone="conf-sysvinit"><primary sortas="e-/etc/inittab">/etc/inittab</primary></indexterm>
|
---|
63 |
|
---|
64 | <para>Create a new file <filename>/etc/inittab</filename> by running the
|
---|
65 | following:</para>
|
---|
66 |
|
---|
67 | <screen><userinput>cat > /etc/inittab << "EOF"
|
---|
68 | <literal># Begin /etc/inittab
|
---|
69 |
|
---|
70 | id:3:initdefault:
|
---|
71 |
|
---|
72 | si::sysinit:/etc/rc.d/init.d/rc sysinit
|
---|
73 |
|
---|
74 | l0:0:wait:/etc/rc.d/init.d/rc 0
|
---|
75 | l1:S1:wait:/etc/rc.d/init.d/rc 1
|
---|
76 | l2:2:wait:/etc/rc.d/init.d/rc 2
|
---|
77 | l3:3:wait:/etc/rc.d/init.d/rc 3
|
---|
78 | l4:4:wait:/etc/rc.d/init.d/rc 4
|
---|
79 | l5:5:wait:/etc/rc.d/init.d/rc 5
|
---|
80 | l6:6:wait:/etc/rc.d/init.d/rc 6
|
---|
81 |
|
---|
82 | ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
|
---|
83 |
|
---|
84 | su:S016:once:/sbin/sulogin
|
---|
85 |
|
---|
86 | 1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
|
---|
87 | 2:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
|
---|
88 | 3:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
|
---|
89 | 4:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
|
---|
90 | 5:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
|
---|
91 | 6:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600
|
---|
92 |
|
---|
93 | # End /etc/inittab</literal>
|
---|
94 | EOF</userinput></screen>
|
---|
95 |
|
---|
96 | <para>The <parameter>-I '\033(K'</parameter> option tells
|
---|
97 | <command>agetty</command> to send this escape sequence to the terminal
|
---|
98 | before doing anything else. This escape sequence switches the console
|
---|
99 | character set to a user-defined one, which can be modified by running
|
---|
100 | the <command>setfont</command> program. The <command>console</command>
|
---|
101 | initscript from the LFS-Bootscripts package calls the <command>setfont</command>
|
---|
102 | program during system startup. Sending this escape sequence is
|
---|
103 | necessary for people who use non-ISO 8859-1 screen fonts, but it does
|
---|
104 | not affect native English speakers.</para>
|
---|
105 |
|
---|
106 | <beginpage/>
|
---|
107 |
|
---|
108 | </sect2>
|
---|
109 |
|
---|
110 | <sect2 id="contents-sysvinit" role="content"><title>Contents of Sysvinit</title>
|
---|
111 |
|
---|
112 | <segmentedlist>
|
---|
113 | <segtitle>Installed programs</segtitle>
|
---|
114 | <seglistitem><seg>halt, init, killall5, last, lastb (link to last), mesg, pidof (link to
|
---|
115 | killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit
|
---|
116 | (link to init), utmpdump, and wall</seg></seglistitem>
|
---|
117 | </segmentedlist>
|
---|
118 |
|
---|
119 | <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
120 | <?dbfo list-presentation="list"?>
|
---|
121 | <?dbhtml list-presentation="table"?>
|
---|
122 |
|
---|
123 | <varlistentry id="halt">
|
---|
124 | <term><command>halt</command></term>
|
---|
125 | <listitem>
|
---|
126 | <para>Normally invokes <command>shutdown</command> with the
|
---|
127 | <parameter>-h</parameter> option, except when already in run-level 0,
|
---|
128 | then it tells the kernel to halt the system; it notes in the
|
---|
129 | file <filename>/var/log/wtmp</filename> that the system is being
|
---|
130 | brought down</para>
|
---|
131 | <indexterm zone="ch-system-sysvinit halt"><primary sortas="b-halt">halt</primary></indexterm>
|
---|
132 | </listitem>
|
---|
133 | </varlistentry>
|
---|
134 |
|
---|
135 | <varlistentry id="init">
|
---|
136 | <term><command>init</command></term>
|
---|
137 | <listitem>
|
---|
138 | <para>The first process to be started when the kernel has initialized
|
---|
139 | the hardware which takes over the boot process and
|
---|
140 | starts all the proceses it is instructed to</para>
|
---|
141 | <indexterm zone="ch-system-sysvinit init"><primary sortas="b-init">init</primary></indexterm>
|
---|
142 | </listitem>
|
---|
143 | </varlistentry>
|
---|
144 |
|
---|
145 | <varlistentry id="killall5">
|
---|
146 | <term><command>killall5</command></term>
|
---|
147 | <listitem>
|
---|
148 | <para>Sends a signal to all processes, except the processes in its own
|
---|
149 | session so it will not kill the shell running the script that called
|
---|
150 | it</para>
|
---|
151 | <indexterm zone="ch-system-sysvinit killall5"><primary sortas="b-killall5">killall5</primary></indexterm>
|
---|
152 | </listitem>
|
---|
153 | </varlistentry>
|
---|
154 |
|
---|
155 | <varlistentry id="last">
|
---|
156 | <term><command>last</command></term>
|
---|
157 | <listitem>
|
---|
158 | <para>Shows which users last logged in (and out),
|
---|
159 | searching back through the <filename>/var/log/wtmp</filename> file; it
|
---|
160 | also shows system boots, shutdowns, and run-level changes</para>
|
---|
161 | <indexterm zone="ch-system-sysvinit last"><primary sortas="b-last">last</primary></indexterm>
|
---|
162 | </listitem>
|
---|
163 | </varlistentry>
|
---|
164 |
|
---|
165 | <varlistentry id="lastb">
|
---|
166 | <term><command>lastb</command></term>
|
---|
167 | <listitem>
|
---|
168 | <para>Shows the failed login attempts, as logged in
|
---|
169 | <filename>/var/log/btmp</filename></para>
|
---|
170 | <indexterm zone="ch-system-sysvinit lastb"><primary sortas="b-lastb">lastb</primary></indexterm>
|
---|
171 | </listitem>
|
---|
172 | </varlistentry>
|
---|
173 |
|
---|
174 | <varlistentry id="mesg">
|
---|
175 | <term><command>mesg</command></term>
|
---|
176 | <listitem>
|
---|
177 | <para>Controls whether other users can send messages to the current
|
---|
178 | user's terminal</para>
|
---|
179 | <indexterm zone="ch-system-sysvinit mesg"><primary sortas="b-mesg">mesg</primary></indexterm>
|
---|
180 | </listitem>
|
---|
181 | </varlistentry>
|
---|
182 |
|
---|
183 | <varlistentry id="mountpoint">
|
---|
184 | <term><command>mountpoint</command></term>
|
---|
185 | <listitem>
|
---|
186 | <para>Checks if the directory is a mountpoint</para>
|
---|
187 | <indexterm zone="ch-system-sysvinit mountpoint"><primary sortas="b-mountpoint">mountpoint</primary></indexterm>
|
---|
188 | </listitem>
|
---|
189 | </varlistentry>
|
---|
190 |
|
---|
191 | <varlistentry id="pidof">
|
---|
192 | <term><command>pidof</command></term>
|
---|
193 | <listitem>
|
---|
194 | <para>Reports the PIDs of the given programs</para>
|
---|
195 | <indexterm zone="ch-system-sysvinit pidof"><primary sortas="b-pidof">pidof</primary></indexterm>
|
---|
196 | </listitem>
|
---|
197 | </varlistentry>
|
---|
198 |
|
---|
199 | <varlistentry id="poweroff">
|
---|
200 | <term><command>poweroff</command></term>
|
---|
201 | <listitem>
|
---|
202 | <para>Tells the kernel to halt the system and switch off the computer
|
---|
203 | (see <command>halt</command>)</para>
|
---|
204 | <indexterm zone="ch-system-sysvinit poweroff"><primary sortas="b-poweroff">poweroff</primary></indexterm>
|
---|
205 | </listitem>
|
---|
206 | </varlistentry>
|
---|
207 |
|
---|
208 | <varlistentry id="reboot">
|
---|
209 | <term><command>reboot</command></term>
|
---|
210 | <listitem>
|
---|
211 | <para>Tells the kernel to reboot the system (see
|
---|
212 | <command>halt</command>)</para>
|
---|
213 | <indexterm zone="ch-system-sysvinit reboot"><primary sortas="b-reboot">reboot</primary></indexterm>
|
---|
214 | </listitem>
|
---|
215 | </varlistentry>
|
---|
216 |
|
---|
217 | <varlistentry id="runlevel">
|
---|
218 | <term><command>runlevel</command></term>
|
---|
219 | <listitem>
|
---|
220 | <para>Reports the previous and the current run-level, as noted in the last run-level
|
---|
221 | record in <filename>/var/run/utmp</filename></para>
|
---|
222 | <indexterm zone="ch-system-sysvinit runlevel"><primary sortas="b-runlevel">runlevel</primary></indexterm>
|
---|
223 | </listitem>
|
---|
224 | </varlistentry>
|
---|
225 |
|
---|
226 | <varlistentry id="shutdown">
|
---|
227 | <term><command>shutdown</command></term>
|
---|
228 | <listitem>
|
---|
229 | <para>Brings the system down in a secure way, signaling all processes
|
---|
230 | and notifying all logged-in users</para>
|
---|
231 | <indexterm zone="ch-system-sysvinit shutdown"><primary sortas="b-shutdown">shutdown</primary></indexterm>
|
---|
232 | </listitem>
|
---|
233 | </varlistentry>
|
---|
234 |
|
---|
235 | <varlistentry id="sulogin">
|
---|
236 | <term><command>sulogin</command></term>
|
---|
237 | <listitem>
|
---|
238 | <para>Allows <emphasis>root</emphasis> to log in; it is
|
---|
239 | normally invoked by <command>init</command> when the system goes into single user mode</para>
|
---|
240 | <indexterm zone="ch-system-sysvinit sulogin"><primary sortas="b-sulogin">sulogin</primary></indexterm>
|
---|
241 | </listitem>
|
---|
242 | </varlistentry>
|
---|
243 |
|
---|
244 | <varlistentry id="telinit">
|
---|
245 | <term><command>telinit</command></term>
|
---|
246 | <listitem>
|
---|
247 | <para>Tells <command>init</command> which run-level to change to</para>
|
---|
248 | <indexterm zone="ch-system-sysvinit telinit"><primary sortas="b-telinit">telinit</primary></indexterm>
|
---|
249 | </listitem>
|
---|
250 | </varlistentry>
|
---|
251 |
|
---|
252 | <varlistentry id="utmpdump">
|
---|
253 | <term><command>utmpdump</command></term>
|
---|
254 | <listitem>
|
---|
255 | <para>Displays the content of the given login file in a more
|
---|
256 | user-friendly format</para>
|
---|
257 | <indexterm zone="ch-system-sysvinit utmpdump"><primary sortas="b-utmpdump">utmpdump</primary></indexterm>
|
---|
258 | </listitem>
|
---|
259 | </varlistentry>
|
---|
260 |
|
---|
261 | <varlistentry id="wall">
|
---|
262 | <term><command>wall</command></term>
|
---|
263 | <listitem>
|
---|
264 | <para>Writes a message to all logged-in users</para>
|
---|
265 | <indexterm zone="ch-system-sysvinit wall"><primary sortas="b-wall">wall</primary></indexterm>
|
---|
266 | </listitem>
|
---|
267 | </varlistentry>
|
---|
268 | </variablelist>
|
---|
269 |
|
---|
270 | </sect2>
|
---|
271 |
|
---|
272 | </sect1>
|
---|
273 |
|
---|