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