source: chapter06/sysvinit.xml@ 6a0e6f3

Last change on this file since 6a0e6f3 was 6a0e6f3, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • Remove the spurious <info> tags that I thought were necessary but evidently aren't

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/LFS-RNG/BOOK@4387 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 9.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE section [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<section xmlns="http://docbook.org/docbook-ng"
7 xml:id="ch-system-sysvinit" xreflabel="Sysvinit" role="wrap">
8<title>Sysvinit-&sysvinit-version;</title>
9<?dbhtml filename="sysvinit.html"?>
10
11<indexterm zone="ch-system-sysvinit"><primary sortas="a-Sysvinit">Sysvinit</primary></indexterm>
12
13<section role="package"><title/>
14<para>The Sysvinit package contains programs for controlling the startup,
15running, and shutdown of your system.</para>
16
17<segmentedlist>
18<segtitle>&buildtime;</segtitle>
19<segtitle>&diskspace;</segtitle>
20<seglistitem><seg>0.1 SBU</seg><seg> 0.9 MB</seg></seglistitem>
21</segmentedlist>
22
23<segmentedlist>
24<segtitle>Sysvinit installation depends on</segtitle>
25<seglistitem><seg>Binutils, Coreutils, GCC, Glibc, Make</seg></seglistitem>
26</segmentedlist>
27</section>
28
29<section role="installation">
30<title>Installation of Sysvinit</title>
31
32<para>Sysvinit &sysvinit-version; contains a <quote>buffer overflow</quote> bug.
33Under some conditions, it clobbers the
34values of environment variables. Fix that:</para>
35
36<screen><userinput>patch -Np1 -i ../sysvinit-&sysvinit-version;-proclen-1.patch</userinput></screen>
37
38<para>When run-levels are changed (for example, when halting the system),
39<command>init</command> sends termination signals to those processes that
40<command>init</command> itself started and that shouldn't be running in the new
41run-level. While doing this, <command>init</command> outputs messages like
42<quote>Sending processes the TERM signal</quote> which seem to imply that it is sending these signals to all currently running processes. To avoid this
43misinterpretation, you can modify the source so that these messages read like
44<quote>Sending processes started by init the TERM signal</quote> instead:</para>
45
46<screen><userinput>sed -i 's@Sending processes@&amp; started by init@g' \
47 src/init.c</userinput></screen>
48
49<para>Compile Sysvinit:</para>
50
51<screen><userinput>make -C src</userinput></screen>
52
53<para>Then install it:</para>
54
55<screen><userinput>make -C src install</userinput></screen>
56
57</section>
58
59
60<section xml:id="conf-sysvinit" role="configuration"><title>Configuring Sysvinit</title>
61<indexterm zone="conf-sysvinit">
62<primary sortas="a-Sysvinit">Sysvinit</primary>
63<secondary>configuring</secondary></indexterm>
64
65<indexterm zone="conf-sysvinit"><primary sortas="e-/etc/inittab">/etc/inittab</primary></indexterm>
66
67<para>Create a new <filename>/etc/inittab</filename> file by running the
68following:</para>
69
70<screen><userinput>cat &gt; /etc/inittab &lt;&lt; "EOF"
71# Begin /etc/inittab
72
73id:3:initdefault:
74
75si::sysinit:/etc/rc.d/init.d/rc sysinit
76
77l0:0:wait:/etc/rc.d/init.d/rc 0
78l1:S1:wait:/etc/rc.d/init.d/rc 1
79l2:2:wait:/etc/rc.d/init.d/rc 2
80l3:3:wait:/etc/rc.d/init.d/rc 3
81l4:4:wait:/etc/rc.d/init.d/rc 4
82l5:5:wait:/etc/rc.d/init.d/rc 5
83l6:6:wait:/etc/rc.d/init.d/rc 6
84
85ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
86
87su:S016:once:/sbin/sulogin
88
891:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
902:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
913:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
924:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
935:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
946:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600
95
96# End /etc/inittab
97EOF</userinput></screen>
98
99<para> The <parameter>-I '\033(K'</parameter> switch tells <command>agetty</command> to send this escape sequence to
100the terminal before doing anything else. This escape sequence switches the
101console character set to a user-defined one, which can be modified by
102running the <command>setfont</command> program.
103Actually, the <command>console</command> initscript from the LFS-Bootscripts
104package calls the <command>setfont</command> program during system
105startup. Sending this escape sequence is necessary for
106people who use non-ISO-8859-1 screen font, but does not hurt native English
107speakers.</para>
108
109</section>
110
111
112<section xml:id="contents-sysvinit" role="content"><title>Contents of Sysvinit</title>
113
114<segmentedlist>
115<segtitle>Installed programs</segtitle>
116<seglistitem><seg>halt, init, killall5, last, lastb (link to last), mesg, pidof (link to
117killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit
118(link to init), utmpdump and wall</seg></seglistitem>
119</segmentedlist>
120
121<variablelist><title>Short descriptions</title>
122
123<varlistentry xml:id="halt">
124<term><command>halt</command></term>
125<listitem>
126<indexterm zone="ch-system-sysvinit halt"><primary sortas="b-halt">halt</primary></indexterm>
127<para>normally invokes <command>shutdown</command> with the <parameter>-h</parameter> flag,
128except when already in run-level 0, then it tells the kernel to halt the system.
129But first it notes in the file <filename>/var/log/wtmp</filename> that the
130system is being brought down.</para>
131</listitem>
132</varlistentry>
133
134<varlistentry xml:id="init">
135<term><command>init</command></term>
136<listitem>
137<indexterm zone="ch-system-sysvinit init"><primary sortas="b-init">init</primary></indexterm>
138<para>is the mother of all processes. It reads its
139commands from <filename>/etc/inittab</filename>, which normally tell it which
140scripts to run for which run-level, and how many gettys to spawn.</para>
141</listitem>
142</varlistentry>
143
144<varlistentry xml:id="killall5">
145<term><command>killall5</command></term>
146<listitem>
147<indexterm zone="ch-system-sysvinit killall5"><primary sortas="b-killall5">killall5</primary></indexterm>
148<para>sends a signal to all processes, except the processes in its own session --
149so it won't kill the shell running the script that called it.</para>
150</listitem>
151</varlistentry>
152
153<varlistentry xml:id="last">
154<term><command>last</command></term>
155<listitem>
156<indexterm zone="ch-system-sysvinit last"><primary sortas="b-last">last</primary></indexterm>
157<para>shows which users last logged in (and out),
158searching back through the file <filename>/var/log/wtmp</filename>. It can
159also show system boots and shutdowns, and run-level changes.</para>
160</listitem>
161</varlistentry>
162
163<varlistentry xml:id="lastb">
164<term><command>lastb</command></term>
165<listitem>
166<indexterm zone="ch-system-sysvinit lastb"><primary sortas="b-lastb">lastb</primary></indexterm>
167<para>shows the failed login attempts, as logged in
168<filename>/var/log/btmp</filename>.</para>
169</listitem>
170</varlistentry>
171
172<varlistentry xml:id="mesg">
173<term><command>mesg</command></term>
174<listitem>
175<indexterm zone="ch-system-sysvinit mesg"><primary sortas="b-mesg">mesg</primary></indexterm>
176<para>controls whether other users can send
177messages to the current user's terminal.</para>
178</listitem>
179</varlistentry>
180
181<varlistentry xml:id="pidof">
182<term><command>pidof</command></term>
183<listitem>
184<indexterm zone="ch-system-sysvinit pidof"><primary sortas="b-pidof">pidof</primary></indexterm>
185<para>reports the PIDs of the given programs.</para>
186</listitem>
187</varlistentry>
188
189<varlistentry xml:id="poweroff">
190<term><command>poweroff</command></term>
191<listitem>
192<indexterm zone="ch-system-sysvinit poweroff"><primary sortas="b-poweroff">poweroff</primary></indexterm>
193<para>tells the kernel to halt the system and
194switch off the computer. But see <command>halt</command>.</para>
195</listitem>
196</varlistentry>
197
198<varlistentry xml:id="reboot">
199<term><command>reboot</command></term>
200<listitem>
201<indexterm zone="ch-system-sysvinit reboot"><primary sortas="b-reboot">reboot</primary></indexterm>
202<para>tells the kernel to reboot the system. But see <command>halt</command>.</para>
203</listitem>
204</varlistentry>
205
206<varlistentry xml:id="runlevel">
207<term><command>runlevel</command></term>
208<listitem>
209<indexterm zone="ch-system-sysvinit runlevel"><primary sortas="b-runlevel">runlevel</primary></indexterm>
210<para>reports the previous and the current run-level, as noted in the last run-level
211record in <filename>/var/run/utmp</filename>.</para>
212</listitem>
213</varlistentry>
214
215<varlistentry xml:id="shutdown">
216<term><command>shutdown</command></term>
217<listitem>
218<indexterm zone="ch-system-sysvinit shutdown"><primary sortas="b-shutdown">shutdown</primary></indexterm>
219<para>brings the system down in a secure way,
220signaling all processes and notifying all logged-in users.</para>
221</listitem>
222</varlistentry>
223
224<varlistentry xml:id="sulogin">
225<term><command>sulogin</command></term>
226<listitem>
227<indexterm zone="ch-system-sysvinit sulogin"><primary sortas="b-sulogin">sulogin</primary></indexterm>
228<para>allows the superuser to log in. It is
229normally invoked by <command>init</command> when the system goes into single user mode.</para>
230</listitem>
231</varlistentry>
232
233<varlistentry xml:id="telinit">
234<term><command>telinit</command></term>
235<listitem>
236<indexterm zone="ch-system-sysvinit telinit"><primary sortas="b-telinit">telinit</primary></indexterm>
237<para>tells <command>init</command> which run-level to enter.</para>
238</listitem>
239</varlistentry>
240
241<varlistentry xml:id="utmpdump">
242<term><command>utmpdump</command></term>
243<listitem>
244<indexterm zone="ch-system-sysvinit utmpdump"><primary sortas="b-utmpdump">utmpdump</primary></indexterm>
245<para>displays the content of the given login file in a friendlier format.</para>
246</listitem>
247</varlistentry>
248
249<varlistentry xml:id="wall">
250<term><command>wall</command></term>
251<listitem>
252<indexterm zone="ch-system-sysvinit wall"><primary sortas="b-wall">wall</primary></indexterm>
253<para>writes a message to all logged-in users.</para>
254</listitem>
255</varlistentry>
256</variablelist>
257
258</section>
259
260</section>
Note: See TracBrowser for help on using the repository browser.