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