source: chapter06/sysvinit.xml@ a48ce94

Last change on this file since a48ce94 was 3f4c310d, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Removed the <beginpage/> tags.

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

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