[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 |
|
---|
[3f2219e] | 29 | <para os="p1">Apply a patch to prevent installation of unneeded programs,
|
---|
| 30 | and allow Sysvinit to be installed in
|
---|
| 31 | <filename class="directory">/tools</filename>:</para>
|
---|
[1425d8c] | 32 |
|
---|
[3f2219e] | 33 | <screen os="p2"><userinput>patch -Np1 -i ../sysvinit-&sysvinit-version;-tools_updates-1.patch</userinput></screen>
|
---|
[dbc8e54] | 34 |
|
---|
[d5f948c] | 35 | <para os ="c">Compile the package:</para>
|
---|
[3f8be484] | 36 |
|
---|
| 37 | <screen os="ac"><userinput>make -C src clobber
|
---|
| 38 | make -C src CC="${CC}"</userinput></screen>
|
---|
| 39 |
|
---|
[d5f948c] | 40 | <para os="e">Install the package:</para>
|
---|
[3f8be484] | 41 |
|
---|
[3832b71] | 42 | <screen os="ad"><userinput>make -C src ROOT=/tools install
|
---|
| 43 | ln -svf /tools/sbin/init ${CLFS}/sbin</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 |
|
---|
[dbc8e54] | 59 | <para>Create a new file <filename>/tools/etc/inittab</filename> by running the
|
---|
[1da2a84] | 60 | following:</para>
|
---|
[3f8be484] | 61 |
|
---|
[dbc8e54] | 62 | <screen><userinput>cat > /tools/etc/inittab << "EOF"
|
---|
| 63 | <literal># Begin /tools/etc/inittab
|
---|
[3f8be484] | 64 |
|
---|
| 65 | id:3:initdefault:
|
---|
| 66 |
|
---|
[54b143f] | 67 | si::sysinit:/tools/etc/rc.d/init.d/rc sysinit
|
---|
| 68 |
|
---|
| 69 | l0:0:wait:/tools/etc/rc.d/init.d/rc 0
|
---|
| 70 | l1:S1:wait:/tools/etc/rc.d/init.d/rc 1
|
---|
| 71 | l2:2:wait:/tools/etc/rc.d/init.d/rc 2
|
---|
| 72 | l3:3:wait:/tools/etc/rc.d/init.d/rc 3
|
---|
| 73 | l4:4:wait:/tools/etc/rc.d/init.d/rc 4
|
---|
| 74 | l5:5:wait:/tools/etc/rc.d/init.d/rc 5
|
---|
| 75 | l6:6:wait:/tools/etc/rc.d/init.d/rc 6
|
---|
[3f8be484] | 76 |
|
---|
[3832b71] | 77 | ca:12345:ctrlaltdel:/tools/sbin/shutdown -t1 -a -r now
|
---|
[3f8be484] | 78 |
|
---|
[dbc8e54] | 79 | su:S016:once:/tools/sbin/sulogin
|
---|
[1da2a84] | 80 | </literal>
|
---|
| 81 | EOF</userinput></screen>
|
---|
| 82 |
|
---|
| 83 | <para>The following command adds the standard virtual terminals to
|
---|
[dbc8e54] | 84 | <filename>/tools/etc/inittab</filename>. If your system only has a serial
|
---|
[1da2a84] | 85 | console skip the following command:</para>
|
---|
[3f8be484] | 86 |
|
---|
[dbc8e54] | 87 | <screen><userinput>cat >> /tools/etc/inittab << "EOF"
|
---|
| 88 | <literal>1:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty1 9600
|
---|
| 89 | 2:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty2 9600
|
---|
| 90 | 3:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty3 9600
|
---|
| 91 | 4:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty4 9600
|
---|
| 92 | 5:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty5 9600
|
---|
| 93 | 6:2345:respawn:/tools/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
|
---|
[dbc8e54] | 98 | the entry to <filename>/tools/etc/inittab</filename>.</para>
|
---|
[1da2a84] | 99 |
|
---|
[dbc8e54] | 100 | <screen><userinput>cat >> /tools/etc/inittab << "EOF"
|
---|
| 101 | <literal>c0:12345:respawn:/tools/sbin/agetty --noclear 115200 ttyS0 vt100
|
---|
[1da2a84] | 102 | </literal>
|
---|
| 103 | EOF</userinput></screen>
|
---|
| 104 |
|
---|
[dbc8e54] | 105 | <para>Finally, add the end line to <filename>/tools/etc/inittab</filename>.</para>
|
---|
[3f8be484] | 106 |
|
---|
[dbc8e54] | 107 | <screen><userinput>cat >> /tools/etc/inittab << "EOF"
|
---|
| 108 | <literal># End /tools/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>
|
---|
[2700ccd] | 130 | <seg>bootlogd, fstab-decode, halt, init, killall5,
|
---|
| 131 | poweroff (link to halt), reboot (link to halt), runlevel,
|
---|
[d5f948c] | 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="poweroff">
|
---|
| 200 | <term><command>poweroff</command></term>
|
---|
| 201 | <listitem>
|
---|
| 202 | <para>Tells the kernel to halt the system and switch off the computer
|
---|
| 203 | (see <command>halt</command>)</para>
|
---|
| 204 | <indexterm zone="ch-boot-sysvinit poweroff">
|
---|
| 205 | <primary sortas="b-poweroff">poweroff</primary>
|
---|
| 206 | </indexterm>
|
---|
| 207 | </listitem>
|
---|
| 208 | </varlistentry>
|
---|
| 209 |
|
---|
| 210 | <varlistentry id="reboot">
|
---|
| 211 | <term><command>reboot</command></term>
|
---|
| 212 | <listitem>
|
---|
| 213 | <para>Tells the kernel to reboot the system (see
|
---|
| 214 | <command>halt</command>)</para>
|
---|
| 215 | <indexterm zone="ch-boot-sysvinit reboot">
|
---|
| 216 | <primary sortas="b-reboot">reboot</primary>
|
---|
| 217 | </indexterm>
|
---|
| 218 | </listitem>
|
---|
| 219 | </varlistentry>
|
---|
| 220 |
|
---|
| 221 | <varlistentry id="runlevel">
|
---|
| 222 | <term><command>runlevel</command></term>
|
---|
| 223 | <listitem>
|
---|
| 224 | <para>Reports the previous and the current run-level, as noted in
|
---|
| 225 | the last run-level record in <filename>/var/run/utmp</filename></para>
|
---|
| 226 | <indexterm zone="ch-boot-sysvinit runlevel">
|
---|
| 227 | <primary sortas="b-runlevel">runlevel</primary>
|
---|
| 228 | </indexterm>
|
---|
| 229 | </listitem>
|
---|
| 230 | </varlistentry>
|
---|
| 231 |
|
---|
| 232 | <varlistentry id="shutdown">
|
---|
| 233 | <term><command>shutdown</command></term>
|
---|
| 234 | <listitem>
|
---|
| 235 | <para>Brings the system down in a secure way, signaling all processes
|
---|
| 236 | and notifying all logged-in users</para>
|
---|
| 237 | <indexterm zone="ch-boot-sysvinit shutdown">
|
---|
| 238 | <primary sortas="b-shutdown">shutdown</primary>
|
---|
| 239 | </indexterm>
|
---|
| 240 | </listitem>
|
---|
| 241 | </varlistentry>
|
---|
| 242 |
|
---|
| 243 | <varlistentry id="telinit">
|
---|
| 244 | <term><command>telinit</command></term>
|
---|
| 245 | <listitem>
|
---|
| 246 | <para>Tells <command>init</command> which run-level to change to</para>
|
---|
| 247 | <indexterm zone="ch-boot-sysvinit telinit">
|
---|
| 248 | <primary sortas="b-telinit">telinit</primary>
|
---|
| 249 | </indexterm>
|
---|
| 250 | </listitem>
|
---|
| 251 | </varlistentry>
|
---|
| 252 |
|
---|
| 253 | </variablelist>
|
---|
| 254 |
|
---|
[3f8be484] | 255 | </sect2>
|
---|
| 256 |
|
---|
| 257 | </sect1>
|
---|