source: BOOK/boot/common/sysvinit.xml@ 79536fe

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

Updated bootscripts to be used in /tools

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