source: chapter06/sysvinit.xml@ fa21b3d

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

Initial support of UTF-8. Thanks Alexander Patrakov.

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

  • Property mode set to 100644
File size: 8.7 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>1012 KB</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>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>This package does not come with a test suite.</para>
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 tty1 9600
882:2345:respawn:/sbin/agetty tty2 9600
893:2345:respawn:/sbin/agetty tty3 9600
904:2345:respawn:/sbin/agetty tty4 9600
915:2345:respawn:/sbin/agetty tty5 9600
926:2345:respawn:/sbin/agetty tty6 9600
93
94# End /etc/inittab</literal>
95EOF</userinput></screen>
96</sect2>
97
98
99<sect2 id="contents-sysvinit" role="content"><title>Contents of Sysvinit</title>
100
101<segmentedlist>
102<segtitle>Installed programs</segtitle>
103<seglistitem><seg>halt, init, killall5, last, lastb (link to last), mesg, pidof (link to
104killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit
105(link to init), utmpdump, and wall</seg></seglistitem>
106</segmentedlist>
107
108<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
109<?dbfo list-presentation="list"?>
110<?dbhtml list-presentation="table"?>
111
112<varlistentry id="halt">
113<term><command>halt</command></term>
114<listitem>
115<para>Normally invokes <command>shutdown</command> with the
116<parameter>-h</parameter> option, except when already in run-level 0,
117then it tells the kernel to halt the system; it notes in the
118file <filename>/var/log/wtmp</filename> that the system is being
119brought down</para>
120<indexterm zone="ch-system-sysvinit halt"><primary sortas="b-halt">halt</primary></indexterm>
121</listitem>
122</varlistentry>
123
124<varlistentry id="init">
125<term><command>init</command></term>
126<listitem>
127<para>The first process to be started when the kernel has initialized
128the hardware which takes over the boot process and
129starts all the proceses it is instructed to</para>
130<indexterm zone="ch-system-sysvinit init"><primary sortas="b-init">init</primary></indexterm>
131</listitem>
132</varlistentry>
133
134<varlistentry id="killall5">
135<term><command>killall5</command></term>
136<listitem>
137<para>Sends a signal to all processes, except the processes in its own
138session so it will not kill the shell running the script that called
139it</para>
140<indexterm zone="ch-system-sysvinit killall5"><primary sortas="b-killall5">killall5</primary></indexterm>
141</listitem>
142</varlistentry>
143
144<varlistentry id="last">
145<term><command>last</command></term>
146<listitem>
147<para>Shows which users last logged in (and out),
148searching back through the <filename>/var/log/wtmp</filename> file; it
149also shows system boots, shutdowns, and run-level changes</para>
150<indexterm zone="ch-system-sysvinit last"><primary sortas="b-last">last</primary></indexterm>
151</listitem>
152</varlistentry>
153
154<varlistentry id="lastb">
155<term><command>lastb</command></term>
156<listitem>
157<para>Shows the failed login attempts, as logged in
158<filename>/var/log/btmp</filename></para>
159<indexterm zone="ch-system-sysvinit lastb"><primary sortas="b-lastb">lastb</primary></indexterm>
160</listitem>
161</varlistentry>
162
163<varlistentry id="mesg">
164<term><command>mesg</command></term>
165<listitem>
166<para>Controls whether other users can send messages to the current
167user's terminal</para>
168<indexterm zone="ch-system-sysvinit mesg"><primary sortas="b-mesg">mesg</primary></indexterm>
169</listitem>
170</varlistentry>
171
172<varlistentry id="mountpoint">
173<term><command>mountpoint</command></term>
174<listitem>
175<para>Checks if the directory is a mountpoint</para>
176<indexterm zone="ch-system-sysvinit mountpoint"><primary sortas="b-mountpoint">mountpoint</primary></indexterm>
177</listitem>
178</varlistentry>
179
180<varlistentry id="pidof">
181<term><command>pidof</command></term>
182<listitem>
183<para>Reports the PIDs of the given programs</para>
184<indexterm zone="ch-system-sysvinit pidof"><primary sortas="b-pidof">pidof</primary></indexterm>
185</listitem>
186</varlistentry>
187
188<varlistentry id="poweroff">
189<term><command>poweroff</command></term>
190<listitem>
191<para>Tells the kernel to halt the system and switch off the computer
192(see <command>halt</command>)</para>
193<indexterm zone="ch-system-sysvinit poweroff"><primary sortas="b-poweroff">poweroff</primary></indexterm>
194</listitem>
195</varlistentry>
196
197<varlistentry id="reboot">
198<term><command>reboot</command></term>
199<listitem>
200<para>Tells the kernel to reboot the system (see
201<command>halt</command>)</para>
202<indexterm zone="ch-system-sysvinit reboot"><primary sortas="b-reboot">reboot</primary></indexterm>
203</listitem>
204</varlistentry>
205
206<varlistentry id="runlevel">
207<term><command>runlevel</command></term>
208<listitem>
209<para>Reports the previous and the current run-level, as noted in the last run-level
210record in <filename>/var/run/utmp</filename></para>
211<indexterm zone="ch-system-sysvinit runlevel"><primary sortas="b-runlevel">runlevel</primary></indexterm>
212</listitem>
213</varlistentry>
214
215<varlistentry id="shutdown">
216<term><command>shutdown</command></term>
217<listitem>
218<para>Brings the system down in a secure way, signaling all processes
219and notifying all logged-in users</para>
220<indexterm zone="ch-system-sysvinit shutdown"><primary sortas="b-shutdown">shutdown</primary></indexterm>
221</listitem>
222</varlistentry>
223
224<varlistentry id="sulogin">
225<term><command>sulogin</command></term>
226<listitem>
227<para>Allows <emphasis>root</emphasis> to log in; it is
228normally invoked by <command>init</command> when the system goes into single user mode</para>
229<indexterm zone="ch-system-sysvinit sulogin"><primary sortas="b-sulogin">sulogin</primary></indexterm>
230</listitem>
231</varlistentry>
232
233<varlistentry id="telinit">
234<term><command>telinit</command></term>
235<listitem>
236<para>Tells <command>init</command> which run-level to change to</para>
237<indexterm zone="ch-system-sysvinit telinit"><primary sortas="b-telinit">telinit</primary></indexterm>
238</listitem>
239</varlistentry>
240
241<varlistentry id="utmpdump">
242<term><command>utmpdump</command></term>
243<listitem>
244<para>Displays the content of the given login file in a more
245user-friendly format</para>
246<indexterm zone="ch-system-sysvinit utmpdump"><primary sortas="b-utmpdump">utmpdump</primary></indexterm>
247</listitem>
248</varlistentry>
249
250<varlistentry id="wall">
251<term><command>wall</command></term>
252<listitem>
253<para>Writes a message to all logged-in users</para>
254<indexterm zone="ch-system-sysvinit wall"><primary sortas="b-wall">wall</primary></indexterm>
255</listitem>
256</varlistentry>
257</variablelist>
258
259</sect2>
260
261</sect1>
262
Note: See TracBrowser for help on using the repository browser.