[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[3f8be484] | 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 |
|
---|
[d5f948c] | 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>
|
---|
[3f8be484] | 25 |
|
---|
| 26 | <sect2 role="installation">
|
---|
| 27 | <title>Installation of Sysvinit</title>
|
---|
| 28 |
|
---|
[1425d8c] | 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}
|
---|
| 33 | sed -e 's/\ sulogin[^ ]*//' -e '/utmpdump/d' -e '/mountpoint/d' \
|
---|
| 34 | -e '/mesg/d' src/Makefile.orig > src/Makefile</userinput></screen>
|
---|
| 35 |
|
---|
[3b0c31e] | 36 | <para os="aa">The following modifications help locate files specific to this
|
---|
[6243b1f] | 37 | particular build:</para>
|
---|
[3f8be484] | 38 |
|
---|
[3b0c31e] | 39 | <screen os="ab"><userinput>cp -v src/Makefile{,.orig}
|
---|
| 40 | sed -e 's,/usr/lib,/tools/lib,g' \
|
---|
| 41 | src/Makefile.orig > src/Makefile</userinput></screen>
|
---|
[3f8be484] | 42 |
|
---|
[dbc8e54] | 43 | <para os="bc">Change the location of inittab:</para>
|
---|
| 44 |
|
---|
| 45 | <screen os="bd"><userinput>cp -v src/paths.h{,.orig}
|
---|
| 46 | sed 's@/etc/inittab@/tools&@' src/paths.h.orig > src/paths.h</userinput></screen>
|
---|
| 47 |
|
---|
[d5f948c] | 48 | <para os ="c">Compile the package:</para>
|
---|
[3f8be484] | 49 |
|
---|
| 50 | <screen os="ac"><userinput>make -C src clobber
|
---|
| 51 | make -C src CC="${CC}"</userinput></screen>
|
---|
| 52 |
|
---|
[d5f948c] | 53 | <para os="e">Install the package:</para>
|
---|
[3f8be484] | 54 |
|
---|
[3832b71] | 55 | <screen os="ad"><userinput>make -C src ROOT=/tools install
|
---|
| 56 | ln -svf /tools/sbin/init ${CLFS}/sbin</userinput></screen>
|
---|
[3f8be484] | 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">
|
---|
[91ad4a4] | 69 | <primary sortas="e-/etc/inittab">/etc/inittab</primary>
|
---|
[3f8be484] | 70 | </indexterm>
|
---|
| 71 |
|
---|
[dbc8e54] | 72 | <para>Create a new file <filename>/tools/etc/inittab</filename> by running the
|
---|
[1da2a84] | 73 | following:</para>
|
---|
[3f8be484] | 74 |
|
---|
[dbc8e54] | 75 | <screen><userinput>cat > /tools/etc/inittab << "EOF"
|
---|
| 76 | <literal># Begin /tools/etc/inittab
|
---|
[3f8be484] | 77 |
|
---|
| 78 | id:3:initdefault:
|
---|
| 79 |
|
---|
[54b143f] | 80 | si::sysinit:/tools/etc/rc.d/init.d/rc sysinit
|
---|
| 81 |
|
---|
| 82 | l0:0:wait:/tools/etc/rc.d/init.d/rc 0
|
---|
| 83 | l1:S1:wait:/tools/etc/rc.d/init.d/rc 1
|
---|
| 84 | l2:2:wait:/tools/etc/rc.d/init.d/rc 2
|
---|
| 85 | l3:3:wait:/tools/etc/rc.d/init.d/rc 3
|
---|
| 86 | l4:4:wait:/tools/etc/rc.d/init.d/rc 4
|
---|
| 87 | l5:5:wait:/tools/etc/rc.d/init.d/rc 5
|
---|
| 88 | l6:6:wait:/tools/etc/rc.d/init.d/rc 6
|
---|
[3f8be484] | 89 |
|
---|
[3832b71] | 90 | ca:12345:ctrlaltdel:/tools/sbin/shutdown -t1 -a -r now
|
---|
[3f8be484] | 91 |
|
---|
[dbc8e54] | 92 | su:S016:once:/tools/sbin/sulogin
|
---|
[1da2a84] | 93 | </literal>
|
---|
| 94 | EOF</userinput></screen>
|
---|
| 95 |
|
---|
| 96 | <para>The following command adds the standard virtual terminals to
|
---|
[dbc8e54] | 97 | <filename>/tools/etc/inittab</filename>. If your system only has a serial
|
---|
[1da2a84] | 98 | console skip the following command:</para>
|
---|
[3f8be484] | 99 |
|
---|
[dbc8e54] | 100 | <screen><userinput>cat >> /tools/etc/inittab << "EOF"
|
---|
| 101 | <literal>1:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty1 9600
|
---|
| 102 | 2:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty2 9600
|
---|
| 103 | 3:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty3 9600
|
---|
| 104 | 4:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty4 9600
|
---|
| 105 | 5:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty5 9600
|
---|
| 106 | 6:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty6 9600
|
---|
[1da2a84] | 107 | </literal>
|
---|
| 108 | EOF</userinput></screen>
|
---|
| 109 |
|
---|
[d1ff581] | 110 | <para>If your system has a serial console, run the following command to add
|
---|
[dbc8e54] | 111 | the entry to <filename>/tools/etc/inittab</filename>.</para>
|
---|
[1da2a84] | 112 |
|
---|
[dbc8e54] | 113 | <screen><userinput>cat >> /tools/etc/inittab << "EOF"
|
---|
| 114 | <literal>c0:12345:respawn:/tools/sbin/agetty --noclear 115200 ttyS0 vt100
|
---|
[1da2a84] | 115 | </literal>
|
---|
| 116 | EOF</userinput></screen>
|
---|
| 117 |
|
---|
[dbc8e54] | 118 | <para>Finally, add the end line to <filename>/tools/etc/inittab</filename>.</para>
|
---|
[3f8be484] | 119 |
|
---|
[dbc8e54] | 120 | <screen><userinput>cat >> /tools/etc/inittab << "EOF"
|
---|
| 121 | <literal># End /tools/etc/inittab</literal>
|
---|
[3f8be484] | 122 | EOF</userinput></screen>
|
---|
| 123 |
|
---|
[d5f948c] | 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>
|
---|
[2700ccd] | 143 | <seg>bootlogd, fstab-decode, halt, init, killall5,
|
---|
| 144 | poweroff (link to halt), reboot (link to halt), runlevel,
|
---|
[d5f948c] | 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 |
|
---|
[3f8be484] | 268 | </sect2>
|
---|
| 269 |
|
---|
| 270 | </sect1>
|
---|