source: BOOK/boot/common/sysvinit.xml@ 1425d8c

clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 1425d8c was 1425d8c, checked in by Chris Staub <chris@…>, 11 years ago

Prevent sysvinit from installing unneeded progs (thanks for the reminder, Martin Ward)

  • 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.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-boot-sysvinit" role="wrap">
9 <?dbhtml filename="sysvinit.html"?>
10
11 <title>Sysvinit-&sysvinit-version;</title>
12
13 <indexterm zone="ch-boot-sysvinit">
14 <primary sortas="a-Sysvinit">Sysvinit</primary>
15 <secondary>boot</secondary>
16 </indexterm>
17
18 <sect2 role="package">
19 <title/>
20
21 <para>The Sysvinit package contains programs for controlling the startup,
22 running, and shutdown of the system.</para>
23
24 </sect2>
25
26 <sect2 role="installation">
27 <title>Installation of Sysvinit</title>
28
29 <para os="s1">Prevent several programs from being built, as better versions
30 were already installed by Util-linux:</para>
31
32<screen os="s2"><userinput>cp -v src/Makefile{,.orig}
33sed -e 's/\ sulogin[^ ]*//' -e '/utmpdump/d' -e '/mountpoint/d' \
34 -e '/mesg/d' src/Makefile.orig &gt; src/Makefile</userinput></screen>
35
36 <para os="aa">The following modifications help locate files specific to this
37 particular build:</para>
38
39<screen os="ab"><userinput>cp -v src/Makefile{,.orig}
40sed -e 's,/usr/lib,/tools/lib,g' \
41 src/Makefile.orig > src/Makefile</userinput></screen>
42
43 <para os="bc">Change the location of inittab:</para>
44
45<screen os="bd"><userinput>cp -v src/paths.h{,.orig}
46sed 's@/etc/inittab@/tools&amp;@' src/paths.h.orig &gt; src/paths.h</userinput></screen>
47
48 <para os ="c">Compile the package:</para>
49
50<screen os="ac"><userinput>make -C src clobber
51make -C src CC="${CC}"</userinput></screen>
52
53 <para os="e">Install the package:</para>
54
55<screen os="ad"><userinput>make -C src ROOT=/tools install
56ln -svf /tools/sbin/init ${CLFS}/sbin</userinput></screen>
57
58 </sect2>
59
60 <sect2 id="conf-tools-sysvinit" role="configuration">
61 <title>Configuring Sysvinit</title>
62
63 <indexterm zone="conf-tools-sysvinit">
64 <primary sortas="a-Sysvinit">Sysvinit</primary>
65 <secondary>boot, configuring</secondary>
66 </indexterm>
67
68 <indexterm zone="conf-tools-sysvinit">
69 <primary sortas="e-/etc/inittab">/etc/inittab</primary>
70 </indexterm>
71
72 <para>Create a new file <filename>/tools/etc/inittab</filename> by running the
73 following:</para>
74
75<screen><userinput>cat &gt; /tools/etc/inittab &lt;&lt; "EOF"
76<literal># Begin /tools/etc/inittab
77
78id:3:initdefault:
79
80si::sysinit:/tools/etc/rc.d/init.d/rc sysinit
81
82l0:0:wait:/tools/etc/rc.d/init.d/rc 0
83l1:S1:wait:/tools/etc/rc.d/init.d/rc 1
84l2:2:wait:/tools/etc/rc.d/init.d/rc 2
85l3:3:wait:/tools/etc/rc.d/init.d/rc 3
86l4:4:wait:/tools/etc/rc.d/init.d/rc 4
87l5:5:wait:/tools/etc/rc.d/init.d/rc 5
88l6:6:wait:/tools/etc/rc.d/init.d/rc 6
89
90ca:12345:ctrlaltdel:/tools/sbin/shutdown -t1 -a -r now
91
92su:S016:once:/tools/sbin/sulogin
93</literal>
94EOF</userinput></screen>
95
96 <para>The following command adds the standard virtual terminals to
97 <filename>/tools/etc/inittab</filename>. If your system only has a serial
98 console skip the following command:</para>
99
100<screen><userinput>cat &gt;&gt; /tools/etc/inittab &lt;&lt; "EOF"
101<literal>1:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty1 9600
1022:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty2 9600
1033:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty3 9600
1044:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty4 9600
1055:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty5 9600
1066:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty6 9600
107</literal>
108EOF</userinput></screen>
109
110 <para>If your system has a serial console, run the following command to add
111 the entry to <filename>/tools/etc/inittab</filename>.</para>
112
113<screen><userinput>cat &gt;&gt; /tools/etc/inittab &lt;&lt; "EOF"
114<literal>c0:12345:respawn:/tools/sbin/agetty --noclear 115200 ttyS0 vt100
115</literal>
116EOF</userinput></screen>
117
118 <para>Finally, add the end line to <filename>/tools/etc/inittab</filename>.</para>
119
120<screen><userinput>cat &gt;&gt; /tools/etc/inittab &lt;&lt; "EOF"
121<literal># End /tools/etc/inittab</literal>
122EOF</userinput></screen>
123
124 <para>The <parameter>-I '\033(K'</parameter> option tells
125 <command>agetty</command> to send this escape sequence to the terminal
126 before doing anything else. This escape sequence switches the console
127 character set to a user-defined one, which can be modified by running
128 the <command>setfont</command> program. The <command>console</command>
129 initscript from the CLFS-Bootscripts package calls the
130 <command>setfont</command> program during system startup. Sending this
131 escape sequence is necessary for people who use non-ISO 8859-1 screen
132 fonts, but it does not affect native English speakers.</para>
133
134 </sect2>
135
136 <sect2 id="contents-sysvinit" role="content">
137 <title>Contents of Sysvinit</title>
138
139 <segmentedlist>
140 <segtitle>Installed programs</segtitle>
141
142 <seglistitem>
143 <seg>bootlogd, fstab-decode, halt, init, killall5,
144 poweroff (link to halt), reboot (link to halt), runlevel,
145 shutdown, and telinit (link to init)</seg>
146 </seglistitem>
147 </segmentedlist>
148
149 <variablelist>
150 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
151 <?dbfo list-presentation="list"?>
152 <?dbhtml list-presentation="table"?>
153
154 <varlistentry id="bootlogd">
155 <term><command>bootlogd</command></term>
156 <listitem>
157 <para>Logs boot messages to a log file</para>
158 <indexterm zone="ch-boot-sysvinit bootlogd">
159 <primary sortas="b-bootlogd">bootlogd</primary>
160 </indexterm>
161 </listitem>
162 </varlistentry>
163
164 <varlistentry id="fstab-decode">
165 <term><command>fstab-decode</command></term>
166 <listitem>
167 <para>Runs a command with fstab-encoded arguments</para>
168 <indexterm zone="ch-boot-sysvinit fstab-decode">
169 <primary sortas="b-fstab-decode">fstab-decode</primary>
170 </indexterm>
171 </listitem>
172 </varlistentry>
173
174 <varlistentry id="halt">
175 <term><command>halt</command></term>
176 <listitem>
177 <para>Normally invokes <command>shutdown</command> with the
178 <parameter>-h</parameter> option, except when already in run-level 0,
179 then it tells the kernel to halt the system; it notes in the
180 file <filename>/var/log/wtmp</filename> that the system is being
181 brought down</para>
182 <indexterm zone="ch-boot-sysvinit halt">
183 <primary sortas="b-halt">halt</primary>
184 </indexterm>
185 </listitem>
186 </varlistentry>
187
188 <varlistentry id="init">
189 <term><command>init</command></term>
190 <listitem>
191 <para>The first process to be started when the kernel has initialized
192 the hardware which takes over the boot process and starts all the
193 proceses it is instructed to</para>
194 <indexterm zone="ch-boot-sysvinit init">
195 <primary sortas="b-init">init</primary>
196 </indexterm>
197 </listitem>
198 </varlistentry>
199
200 <varlistentry id="killall5">
201 <term><command>killall5</command></term>
202 <listitem>
203 <para>Sends a signal to all processes, except the processes in its own
204 session so it will not kill the shell running the script that called
205 it</para>
206 <indexterm zone="ch-boot-sysvinit killall5">
207 <primary sortas="b-killall5">killall5</primary>
208 </indexterm>
209 </listitem>
210 </varlistentry>
211
212 <varlistentry id="poweroff">
213 <term><command>poweroff</command></term>
214 <listitem>
215 <para>Tells the kernel to halt the system and switch off the computer
216 (see <command>halt</command>)</para>
217 <indexterm zone="ch-boot-sysvinit poweroff">
218 <primary sortas="b-poweroff">poweroff</primary>
219 </indexterm>
220 </listitem>
221 </varlistentry>
222
223 <varlistentry id="reboot">
224 <term><command>reboot</command></term>
225 <listitem>
226 <para>Tells the kernel to reboot the system (see
227 <command>halt</command>)</para>
228 <indexterm zone="ch-boot-sysvinit reboot">
229 <primary sortas="b-reboot">reboot</primary>
230 </indexterm>
231 </listitem>
232 </varlistentry>
233
234 <varlistentry id="runlevel">
235 <term><command>runlevel</command></term>
236 <listitem>
237 <para>Reports the previous and the current run-level, as noted in
238 the last run-level record in <filename>/var/run/utmp</filename></para>
239 <indexterm zone="ch-boot-sysvinit runlevel">
240 <primary sortas="b-runlevel">runlevel</primary>
241 </indexterm>
242 </listitem>
243 </varlistentry>
244
245 <varlistentry id="shutdown">
246 <term><command>shutdown</command></term>
247 <listitem>
248 <para>Brings the system down in a secure way, signaling all processes
249 and notifying all logged-in users</para>
250 <indexterm zone="ch-boot-sysvinit shutdown">
251 <primary sortas="b-shutdown">shutdown</primary>
252 </indexterm>
253 </listitem>
254 </varlistentry>
255
256 <varlistentry id="telinit">
257 <term><command>telinit</command></term>
258 <listitem>
259 <para>Tells <command>init</command> which run-level to change to</para>
260 <indexterm zone="ch-boot-sysvinit telinit">
261 <primary sortas="b-telinit">telinit</primary>
262 </indexterm>
263 </listitem>
264 </varlistentry>
265
266 </variablelist>
267
268 </sect2>
269
270</sect1>
Note: See TracBrowser for help on using the repository browser.