source: chapter06/sysvinit.xml@ a0e1913

Last change on this file since a0e1913 was a0e1913, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Removed the package name from the dependencies titles.

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

  • Property mode set to 100644
File size: 9.5 KB
Line 
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,
14running, 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> 0.9 MB</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>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 the package:</para>
52
53<screen arch="x86"><userinput>make -C src</userinput></screen>
54
55<screen arch="raq2"><userinput>make -C src clobber
56make -C src</userinput></screen>
57
58<para>Install the package:</para>
59
60<screen><userinput>make -C src install</userinput></screen>
61
62
63</sect2>
64
65
66<sect2 id="conf-sysvinit" role="configuration"><title>Configuring Sysvinit</title>
67<indexterm zone="conf-sysvinit">
68<primary sortas="a-Sysvinit">Sysvinit</primary>
69<secondary>configuring</secondary></indexterm>
70
71<indexterm zone="conf-sysvinit"><primary sortas="e-/etc/inittab">/etc/inittab</primary></indexterm>
72
73<para>Create a new file <filename>/etc/inittab</filename> by running the
74following:</para>
75
76<screen><userinput>cat &gt; /etc/inittab &lt;&lt; "EOF"
77<literal># Begin /etc/inittab
78
79id:3:initdefault:
80
81si::sysinit:/etc/rc.d/init.d/rc sysinit
82
83l0:0:wait:/etc/rc.d/init.d/rc 0
84l1:S1:wait:/etc/rc.d/init.d/rc 1
85l2:2:wait:/etc/rc.d/init.d/rc 2
86l3:3:wait:/etc/rc.d/init.d/rc 3
87l4:4:wait:/etc/rc.d/init.d/rc 4
88l5:5:wait:/etc/rc.d/init.d/rc 5
89l6:6:wait:/etc/rc.d/init.d/rc 6
90
91ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
92
93su:S016:once:/sbin/sulogin</literal>
94
95<literal arch="x86">1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
962:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
973:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
984:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
995:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
1006:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600</literal>
101
102<literal arch="raq2">c0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100</literal>
103
104<literal># End /etc/inittab</literal>
105EOF</userinput></screen>
106
107<para arch="x86">The <parameter>-I '\033(K'</parameter> option tells
108<command>agetty</command> to send this escape sequence to the terminal
109before doing anything else. This escape sequence switches the console
110character set to a user-defined one, which can be modified by running
111the <command>setfont</command> program. The <command>console</command>
112initscript from the LFS-Bootscripts package calls the <command>setfont</command>
113program during system startup. Sending this escape sequence is
114necessary for people who use non-ISO 8859-1 screen fonts, but it does
115not effect native English speakers.</para>
116
117
118</sect2>
119
120
121<sect2 id="contents-sysvinit" role="content"><title>Contents of Sysvinit</title>
122
123<segmentedlist>
124<segtitle>Installed programs</segtitle>
125<seglistitem><seg>halt, init, killall5, last, lastb (link to last), mesg, pidof (link to
126killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit
127(link to init), utmpdump, and wall</seg></seglistitem>
128</segmentedlist>
129
130<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
131<?dbfo list-presentation="list"?>
132<?dbhtml list-presentation="table"?>
133
134<varlistentry id="halt">
135<term><command>halt</command></term>
136<listitem>
137<para>Normally invokes <command>shutdown</command> with the
138<parameter>-h</parameter> option, except when already in run-level 0,
139then it tells the kernel to halt the system; it notes in the
140file <filename>/var/log/wtmp</filename> that the system is being
141brought down</para>
142<indexterm zone="ch-system-sysvinit halt"><primary sortas="b-halt">halt</primary></indexterm>
143</listitem>
144</varlistentry>
145
146<varlistentry id="init">
147<term><command>init</command></term>
148<listitem>
149<para>The first process to be started when the kernel has initialized
150the hardware which takes over the boot process and
151starts all the proceses it is instructed to</para>
152<indexterm zone="ch-system-sysvinit init"><primary sortas="b-init">init</primary></indexterm>
153</listitem>
154</varlistentry>
155
156<varlistentry id="killall5">
157<term><command>killall5</command></term>
158<listitem>
159<para>Sends a signal to all processes, except the processes in its own
160session so it will not kill the shell running the script that called
161it</para>
162<indexterm zone="ch-system-sysvinit killall5"><primary sortas="b-killall5">killall5</primary></indexterm>
163</listitem>
164</varlistentry>
165
166<varlistentry id="last">
167<term><command>last</command></term>
168<listitem>
169<para>Shows which users last logged in (and out),
170searching back through the <filename>/var/log/wtmp</filename> file; it
171also shows system boots, shutdowns, and run-level changes</para>
172<indexterm zone="ch-system-sysvinit last"><primary sortas="b-last">last</primary></indexterm>
173</listitem>
174</varlistentry>
175
176<varlistentry id="lastb">
177<term><command>lastb</command></term>
178<listitem>
179<para>Shows the failed login attempts, as logged in
180<filename>/var/log/btmp</filename></para>
181<indexterm zone="ch-system-sysvinit lastb"><primary sortas="b-lastb">lastb</primary></indexterm>
182</listitem>
183</varlistentry>
184
185<varlistentry id="mesg">
186<term><command>mesg</command></term>
187<listitem>
188<para>Controls whether other users can send messages to the current
189user's terminal</para>
190<indexterm zone="ch-system-sysvinit mesg"><primary sortas="b-mesg">mesg</primary></indexterm>
191</listitem>
192</varlistentry>
193
194<varlistentry id="pidof">
195<term><command>pidof</command></term>
196<listitem>
197<para>Reports the PIDs of the given programs</para>
198<indexterm zone="ch-system-sysvinit pidof"><primary sortas="b-pidof">pidof</primary></indexterm>
199</listitem>
200</varlistentry>
201
202<varlistentry id="poweroff">
203<term><command>poweroff</command></term>
204<listitem>
205<para>Tells the kernel to halt the system and switch off the computer
206(see <command>halt</command>)</para>
207<indexterm zone="ch-system-sysvinit poweroff"><primary sortas="b-poweroff">poweroff</primary></indexterm>
208</listitem>
209</varlistentry>
210
211<varlistentry id="reboot">
212<term><command>reboot</command></term>
213<listitem>
214<para>Tells the kernel to reboot the system (see
215<command>halt</command>)</para>
216<indexterm zone="ch-system-sysvinit reboot"><primary sortas="b-reboot">reboot</primary></indexterm>
217</listitem>
218</varlistentry>
219
220<varlistentry id="runlevel">
221<term><command>runlevel</command></term>
222<listitem>
223<para>Reports the previous and the current run-level, as noted in the last run-level
224record in <filename>/var/run/utmp</filename></para>
225<indexterm zone="ch-system-sysvinit runlevel"><primary sortas="b-runlevel">runlevel</primary></indexterm>
226</listitem>
227</varlistentry>
228
229<varlistentry id="shutdown">
230<term><command>shutdown</command></term>
231<listitem>
232<para>Brings the system down in a secure way, signaling all processes
233and notifying all logged-in users</para>
234<indexterm zone="ch-system-sysvinit shutdown"><primary sortas="b-shutdown">shutdown</primary></indexterm>
235</listitem>
236</varlistentry>
237
238<varlistentry id="sulogin">
239<term><command>sulogin</command></term>
240<listitem>
241<para>Allows <emphasis>root</emphasis> to log in; it is
242normally invoked by <command>init</command> when the system goes into single user mode</para>
243<indexterm zone="ch-system-sysvinit sulogin"><primary sortas="b-sulogin">sulogin</primary></indexterm>
244</listitem>
245</varlistentry>
246
247<varlistentry id="telinit">
248<term><command>telinit</command></term>
249<listitem>
250<para>Tells <command>init</command> which run-level to change to</para>
251<indexterm zone="ch-system-sysvinit telinit"><primary sortas="b-telinit">telinit</primary></indexterm>
252</listitem>
253</varlistentry>
254
255<varlistentry id="utmpdump">
256<term><command>utmpdump</command></term>
257<listitem>
258<para>Displays the content of the given login file in a more
259user-friendly format</para>
260<indexterm zone="ch-system-sysvinit utmpdump"><primary sortas="b-utmpdump">utmpdump</primary></indexterm>
261</listitem>
262</varlistentry>
263
264<varlistentry id="wall">
265<term><command>wall</command></term>
266<listitem>
267<para>Writes a message to all logged-in users</para>
268<indexterm zone="ch-system-sysvinit wall"><primary sortas="b-wall">wall</primary></indexterm>
269</listitem>
270</varlistentry>
271</variablelist>
272
273</sect2>
274
275</sect1>
276
Note: See TracBrowser for help on using the repository browser.