source: BOOK/final-system/common/sysvinit.xml@ d772cfe

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since d772cfe was 3f8be484, checked in by Jim Gifford <clfs@…>, 19 years ago

r627@server (orig r625): jim | 2005-10-31 12:59:34 -0800
Import of Cross-LFS Book

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