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