source: chapter06/sysvinit.xml@ a001133

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.0 6.1 6.1.1 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 a001133 was a001133, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

HEAD: Retaged the introductori packages sections in chapter0{6,7,8}

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

  • Property mode set to 100644
File size: 7.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-sysvinit" xreflabel="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 your 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, 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 system),
32<command>init</command> sends termination signals to those processes that
33<command>init</command> itself started and that shouldn't be running in the new
34run-level. While doing this, <command>init</command> outputs messages like
35<quote>Sending processes the TERM signal</quote> which seem to imply that it is sending these signals to all currently running processes. To avoid this
36misinterpretation, you can modify the source so that these messages read like
37<quote>Sending processes started by init the TERM signal</quote> instead:</para>
38
39<screen><userinput>cp src/init.c{,.backup}
40sed 's/Sending processes/&amp; started by init/g' \
41 src/init.c.backup &gt; src/init.c</userinput></screen>
42
43<para>Compile Sysvinit:</para>
44
45<screen><userinput>make -C src</userinput></screen>
46
47<para>Then install it:</para>
48
49<screen><userinput>make -C src install</userinput></screen>
50
51</sect2>
52
53
54<sect2 id="conf-sysvinit"><title>Configuring Sysvinit</title>
55<indexterm zone="conf-sysvinit">
56<primary sortas="a-Sysvinit">Sysvinit</primary>
57<secondary>configuring</secondary></indexterm>
58
59<indexterm zone="conf-sysvinit"><primary sortas="e-/etc/inittab">/etc/inittab</primary></indexterm>
60
61<para>Create a new <filename>/etc/inittab</filename> file by running the
62following:</para>
63
64<screen><userinput>cat &gt; /etc/inittab &lt;&lt; "EOF"</userinput>
65# Begin /etc/inittab
66
67id:3:initdefault:
68
69si::sysinit:/etc/rc.d/init.d/rc sysinit
70
71l0:0:wait:/etc/rc.d/init.d/rc 0
72l1:S1:wait:/etc/rc.d/init.d/rc 1
73l2:2:wait:/etc/rc.d/init.d/rc 2
74l3:3:wait:/etc/rc.d/init.d/rc 3
75l4:4:wait:/etc/rc.d/init.d/rc 4
76l5:5:wait:/etc/rc.d/init.d/rc 5
77l6:6:wait:/etc/rc.d/init.d/rc 6
78
79ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
80
81su:S016:once:/sbin/sulogin
82
831:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
842:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
853:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
864:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
875:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
886:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600
89
90# End /etc/inittab
91<userinput>EOF</userinput></screen>
92
93<para> The -I '\033(K' switch tells agetty to send this escape sequence to
94the terminal before doing anything else. This escape sequence switches the
95console character set to a user-defined one, which can be modified by
96running the <command>setfont</command> program.
97Actually, the <command>console</command> initscript from the LFS-Bootscripts
98package calls the <command>setfont</command> program during system
99startup. Sending this escape sequence is necessary for
100people who use non-ISO-8859-1 screen font, but does not hurt native English
101speakers.</para>
102
103</sect2>
104
105
106<sect2 id="contents-sysvinit"><title>Contents of Sysvinit</title>
107
108<para><emphasis>Installed programs</emphasis>: halt, init, killall5, last,
109lastb (link to last), mesg, pidof (link to killall5), poweroff (link to halt),
110reboot (link to halt), runlevel, shutdown, sulogin, telinit (link to init),
111utmpdump and wall</para>
112
113</sect2>
114
115
116<sect2><title>Short descriptions</title>
117
118<indexterm zone="ch-system-sysvinit halt"><primary sortas="b-halt">halt</primary></indexterm>
119<para id="halt"><command>halt</command> normally invokes shutdown with the -h flag,
120except when already in run-level 0, then it tells the kernel to halt the system.
121But first it notes in the file <filename>/var/log/wtmp</filename> that the
122system is being brought down.</para>
123
124<indexterm zone="ch-system-sysvinit init"><primary sortas="b-init">init</primary></indexterm>
125<para id="init"><command>init</command> is the mother of all processes. It reads its
126commands from <filename>/etc/inittab</filename>, which normally tell it which
127scripts to run for which run-level, and how many gettys to spawn.</para>
128
129<indexterm zone="ch-system-sysvinit killall5"><primary sortas="b-killall5">killall5</primary></indexterm>
130<para id="killall5"><command>killall5</command> sends a signal to all processes, except
131the processes in its own session -- so it won't kill the shell running the
132script that called it.</para>
133
134<indexterm zone="ch-system-sysvinit last"><primary sortas="b-last">last</primary></indexterm>
135<para id="last"><command>last</command> shows which users last logged in (and out),
136searching back through the file <filename>/var/log/wtmp</filename>. It can
137also show system boots and shutdowns, and run-level changes.</para>
138
139<indexterm zone="ch-system-sysvinit lastb"><primary sortas="b-lastb">lastb</primary></indexterm>
140<para id="lastb"><command>lastb</command> shows the failed login attempts, as logged
141in <filename>/var/log/btmp</filename>.</para>
142
143<indexterm zone="ch-system-sysvinit mesg"><primary sortas="b-mesg">mesg</primary></indexterm>
144<para id="mesg"><command>mesg</command> controls whether other users can send
145messages to the current user's terminal.</para>
146
147<indexterm zone="ch-system-sysvinit pidof"><primary sortas="b-pidof">pidof</primary></indexterm>
148<para id="pidof"><command>pidof</command> reports the PIDs of the given programs.</para>
149
150<indexterm zone="ch-system-sysvinit poweroff"><primary sortas="b-poweroff">poweroff</primary></indexterm>
151<para id="poweroff"><command>poweroff</command> tells the kernel to halt the system and
152switch off the computer. But see halt.</para>
153
154<indexterm zone="ch-system-sysvinit reboot"><primary sortas="b-reboot">reboot</primary></indexterm>
155<para id="reboot"><command>reboot</command> tells the kernel to reboot the system.
156But see halt.</para>
157
158<indexterm zone="ch-system-sysvinit runlevel"><primary sortas="b-runlevel">runlevel</primary></indexterm>
159<para id="runlevel"><command>runlevel</command> reports the previous and the current
160run-level, as noted in the last run-level record in
161<filename>/var/run/utmp</filename>.</para>
162
163<indexterm zone="ch-system-sysvinit shutdown"><primary sortas="b-shutdown">shutdown</primary></indexterm>
164<para id="shutdown"><command>shutdown</command> brings the system down in a secure way,
165signaling all processes and notifying all logged-in users.</para>
166
167<indexterm zone="ch-system-sysvinit sulogin"><primary sortas="b-sulogin">sulogin</primary></indexterm>
168<para id="sulogin"><command>sulogin</command> allows the superuser to log in. It is
169normally invoked by init when the system goes into single user mode.</para>
170
171<indexterm zone="ch-system-sysvinit telinit"><primary sortas="b-telinit">telinit</primary></indexterm>
172<para id="telinit"><command>telinit</command> tells init which run-level to enter.</para>
173
174<indexterm zone="ch-system-sysvinit utmpdump"><primary sortas="b-utmpdump">utmpdump</primary></indexterm>
175<para id="utmpdump"><command>utmpdump</command> displays the content of the given login
176file in a friendlier format.</para>
177
178<indexterm zone="ch-system-sysvinit wall"><primary sortas="b-wall">wall</primary></indexterm>
179<para id="wall"><command>wall</command> writes a message to all logged-in users.</para>
180
181</sect2>
182
183
184
185</sect1>
Note: See TracBrowser for help on using the repository browser.