source: chapter06/sysvinit.xml@ 72d7e28

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.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 72d7e28 was 72d7e28, checked in by Jeremy Huntwork <jhuntwork@…>, 18 years ago

Moved all dependency information to a new page, Appendix C.
Appendix C also contains information concerning the build order.
While there might need to be a few tweaks yet, this information is complete
enough at this point to close out the long-standing ticket #684.
Many thanks to Chris Staub, Dan Nicholson and Manuel Canales Esparcia for
helping get this finished.

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

  • Property mode set to 100644
File size: 10.3 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
8<sect1 id="ch-system-sysvinit" role="wrap">
9 <?dbhtml filename="sysvinit.html"?>
10
11 <title>Sysvinit-&sysvinit-version;</title>
12
13 <indexterm zone="ch-system-sysvinit">
14 <primary sortas="a-Sysvinit">Sysvinit</primary>
15 </indexterm>
16
17 <sect2 role="package">
18 <title/>
19
20 <para>The Sysvinit package contains programs for controlling the startup,
21 running, and shutdown of the system.</para>
22
23 <segmentedlist>
24 <segtitle>&buildtime;</segtitle>
25 <segtitle>&diskspace;</segtitle>
26
27 <seglistitem>
28 <seg>0.1 SBU</seg><seg>1012 KB</seg>
29 </seglistitem>
30 </segmentedlist>
31
32 </sect2>
33
34 <sect2 role="installation">
35 <title>Installation of Sysvinit</title>
36
37 <para>When run-levels are changed (for example, when halting the
38 system), <command>init</command> sends termination signals to those
39 processes that <command>init</command> itself started and that should
40 not be running in the new run-level. While doing this,
41 <command>init</command> outputs messages like <quote>Sending processes
42 the TERM signal</quote> which seem to imply that it is sending these
43 signals to all currently running processes. To avoid this
44 misinterpretation, modify the source so that these messages read like
45 <quote>Sending processes started by init the TERM signal</quote>
46 instead:</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><userinput>make -C src</userinput></screen>
54
55 <para>This package does not come with a test suite.</para>
56
57 <para>Install the package:</para>
58
59<screen><userinput>make -C src install</userinput></screen>
60
61 </sect2>
62
63 <sect2 id="conf-sysvinit" role="configuration">
64 <title>Configuring Sysvinit</title>
65
66 <indexterm zone="conf-sysvinit">
67 <primary sortas="a-Sysvinit">Sysvinit</primary>
68 <secondary>configuring</secondary>
69 </indexterm>
70
71 <indexterm zone="conf-sysvinit">
72 <primary sortas="e-/etc/inittab">/etc/inittab</primary>
73 </indexterm>
74
75 <para>Create a new file <filename>/etc/inittab</filename> by running the
76 following:</para>
77
78<screen><userinput>cat &gt; /etc/inittab &lt;&lt; "EOF"
79<literal># Begin /etc/inittab
80
81id:3:initdefault:
82
83si::sysinit:/etc/rc.d/init.d/rc sysinit
84
85l0:0:wait:/etc/rc.d/init.d/rc 0
86l1:S1:wait:/etc/rc.d/init.d/rc 1
87l2:2:wait:/etc/rc.d/init.d/rc 2
88l3:3:wait:/etc/rc.d/init.d/rc 3
89l4:4:wait:/etc/rc.d/init.d/rc 4
90l5:5:wait:/etc/rc.d/init.d/rc 5
91l6:6:wait:/etc/rc.d/init.d/rc 6
92
93ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
94
95su:S016:once:/sbin/sulogin
96
971:2345:respawn:/sbin/agetty tty1 9600
982:2345:respawn:/sbin/agetty tty2 9600
993:2345:respawn:/sbin/agetty tty3 9600
1004:2345:respawn:/sbin/agetty tty4 9600
1015:2345:respawn:/sbin/agetty tty5 9600
1026:2345:respawn:/sbin/agetty tty6 9600
103
104# End /etc/inittab</literal>
105EOF</userinput></screen>
106
107 </sect2>
108
109 <sect2 id="contents-sysvinit" role="content">
110 <title>Contents of Sysvinit</title>
111
112 <segmentedlist>
113 <segtitle>Installed programs</segtitle>
114
115 <seglistitem>
116 <seg>halt, init, killall5, last, lastb (link to last), mesg, mountpoint,
117 pidof (link to killall5), poweroff (link to halt), reboot (link to halt),
118 runlevel, shutdown, sulogin, telinit (link to init), utmpdump, and
119 wall</seg>
120 </seglistitem>
121 </segmentedlist>
122
123 <variablelist>
124 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
125 <?dbfo list-presentation="list"?>
126 <?dbhtml list-presentation="table"?>
127
128 <varlistentry id="halt">
129 <term><command>halt</command></term>
130 <listitem>
131 <para>Normally invokes <command>shutdown</command> with the
132 <parameter>-h</parameter> option, except when already in run-level 0,
133 then it tells the kernel to halt the system; it notes in the
134 file <filename>/var/log/wtmp</filename> that the system is being
135 brought down</para>
136 <indexterm zone="ch-system-sysvinit halt">
137 <primary sortas="b-halt">halt</primary>
138 </indexterm>
139 </listitem>
140 </varlistentry>
141
142 <varlistentry id="init">
143 <term><command>init</command></term>
144 <listitem>
145 <para>The first process to be started when the kernel has initialized
146 the hardware which takes over the boot process and starts all the
147 proceses it is instructed to</para>
148 <indexterm zone="ch-system-sysvinit init">
149 <primary sortas="b-init">init</primary>
150 </indexterm>
151 </listitem>
152 </varlistentry>
153
154 <varlistentry id="killall5">
155 <term><command>killall5</command></term>
156 <listitem>
157 <para>Sends a signal to all processes, except the processes in its own
158 session so it will not kill the shell running the script that called
159 it</para>
160 <indexterm zone="ch-system-sysvinit killall5">
161 <primary sortas="b-killall5">killall5</primary>
162 </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), searching back
170 through the <filename>/var/log/wtmp</filename> file; it also shows
171 system boots, shutdowns, and run-level changes</para>
172 <indexterm zone="ch-system-sysvinit last">
173 <primary sortas="b-last">last</primary>
174 </indexterm>
175 </listitem>
176 </varlistentry>
177
178 <varlistentry id="lastb">
179 <term><command>lastb</command></term>
180 <listitem>
181 <para>Shows the failed login attempts, as logged in
182 <filename>/var/log/btmp</filename></para>
183 <indexterm zone="ch-system-sysvinit lastb">
184 <primary sortas="b-lastb">lastb</primary>
185 </indexterm>
186 </listitem>
187 </varlistentry>
188
189 <varlistentry id="mesg">
190 <term><command>mesg</command></term>
191 <listitem>
192 <para>Controls whether other users can send messages to the current
193 user's terminal</para>
194 <indexterm zone="ch-system-sysvinit mesg">
195 <primary sortas="b-mesg">mesg</primary>
196 </indexterm>
197 </listitem>
198 </varlistentry>
199
200 <varlistentry id="mountpoint">
201 <term><command>mountpoint</command></term>
202 <listitem>
203 <para>Checks if the directory is a mountpoint</para>
204 <indexterm zone="ch-system-sysvinit mountpoint">
205 <primary sortas="b-mountpoint">mountpoint</primary>
206 </indexterm>
207 </listitem>
208 </varlistentry>
209
210 <varlistentry id="pidof">
211 <term><command>pidof</command></term>
212 <listitem>
213 <para>Reports the PIDs of the given programs</para>
214 <indexterm zone="ch-system-sysvinit pidof">
215 <primary sortas="b-pidof">pidof</primary>
216 </indexterm>
217 </listitem>
218 </varlistentry>
219
220 <varlistentry id="poweroff">
221 <term><command>poweroff</command></term>
222 <listitem>
223 <para>Tells the kernel to halt the system and switch off the computer
224 (see <command>halt</command>)</para>
225 <indexterm zone="ch-system-sysvinit poweroff">
226 <primary sortas="b-poweroff">poweroff</primary>
227 </indexterm>
228 </listitem>
229 </varlistentry>
230
231 <varlistentry id="reboot">
232 <term><command>reboot</command></term>
233 <listitem>
234 <para>Tells the kernel to reboot the system (see
235 <command>halt</command>)</para>
236 <indexterm zone="ch-system-sysvinit reboot">
237 <primary sortas="b-reboot">reboot</primary>
238 </indexterm>
239 </listitem>
240 </varlistentry>
241
242 <varlistentry id="runlevel">
243 <term><command>runlevel</command></term>
244 <listitem>
245 <para>Reports the previous and the current run-level, as noted in the
246 last run-level record in <filename>/var/run/utmp</filename></para>
247 <indexterm zone="ch-system-sysvinit runlevel">
248 <primary sortas="b-runlevel">runlevel</primary>
249 </indexterm>
250 </listitem>
251 </varlistentry>
252
253 <varlistentry id="shutdown">
254 <term><command>shutdown</command></term>
255 <listitem>
256 <para>Brings the system down in a secure way, signaling all processes
257 and notifying all logged-in users</para>
258 <indexterm zone="ch-system-sysvinit shutdown">
259 <primary sortas="b-shutdown">shutdown</primary>
260 </indexterm>
261 </listitem>
262 </varlistentry>
263
264 <varlistentry id="sulogin">
265 <term><command>sulogin</command></term>
266 <listitem>
267 <para>Allows <systemitem class="username">root</systemitem> to log in;
268 it is normally invoked by <command>init</command> when the system goes
269 into single user mode</para>
270 <indexterm zone="ch-system-sysvinit sulogin">
271 <primary sortas="b-sulogin">sulogin</primary>
272 </indexterm>
273 </listitem>
274 </varlistentry>
275
276 <varlistentry id="telinit">
277 <term><command>telinit</command></term>
278 <listitem>
279 <para>Tells <command>init</command> which run-level to change to</para>
280 <indexterm zone="ch-system-sysvinit telinit">
281 <primary sortas="b-telinit">telinit</primary>
282 </indexterm>
283 </listitem>
284 </varlistentry>
285
286 <varlistentry id="utmpdump">
287 <term><command>utmpdump</command></term>
288 <listitem>
289 <para>Displays the content of the given login file in a more
290 user-friendly format</para>
291 <indexterm zone="ch-system-sysvinit utmpdump">
292 <primary sortas="b-utmpdump">utmpdump</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296
297 <varlistentry id="wall">
298 <term><command>wall</command></term>
299 <listitem>
300 <para>Writes a message to all logged-in users</para>
301 <indexterm zone="ch-system-sysvinit wall">
302 <primary sortas="b-wall">wall</primary>
303 </indexterm>
304 </listitem>
305 </varlistentry>
306
307 </variablelist>
308
309 </sect2>
310
311</sect1>
Note: See TracBrowser for help on using the repository browser.