source: chapter06/sysvinit.xml@ 12a2975c

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 12a2975c was 12a2975c, checked in by Bryan Kadzban <bryan@…>, 18 years ago

Modified sysvinit sed for clarity

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

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