source: chapter06/sysvinit.xml@ 3e36a78

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 3e36a78 was 3e36a78, checked in by Jim Gifford <jim@…>, 19 years ago

Changed patches to use entities

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

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