source: chapter06/sysvinit.xml@ 8f97096

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 8f97096 was 8f97096, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Changed the Short Descriptions sections to table format for XHTML output.

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