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