source: chapter06/sysvinit.xml@ 3ed279f

6.0
Last change on this file since 3ed279f was 3ed279f, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Tags changes in the contents sections to make a better print output.

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