source: chapter06/sysvinit.xml@ 1609da8

Last change on this file since 1609da8 was 1609da8, checked in by Matthew Burgess <matthew@…>, 20 years ago

Upgraded to DocBook 4.4 DTD

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