[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[ddd5542] | 7 |
|
---|
[81fd230] | 8 | <sect1 id="ch-system-sysvinit" role="wrap">
|
---|
[ddd5542] | 9 | <?dbhtml filename="sysvinit.html"?>
|
---|
| 10 |
|
---|
[e747759] | 11 | <sect1info condition="script">
|
---|
| 12 | <productname>sysvinit</productname>
|
---|
| 13 | <productnumber>&sysvinit-version;</productnumber>
|
---|
| 14 | <address>&sysvinit-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
[ddd5542] | 17 | <title>Sysvinit-&sysvinit-version;</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-system-sysvinit">
|
---|
| 20 | <primary sortas="a-Sysvinit">Sysvinit</primary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect2 role="package">
|
---|
| 24 | <title/>
|
---|
| 25 |
|
---|
| 26 | <para>The Sysvinit package contains programs for controlling the startup,
|
---|
| 27 | running, and shutdown of the system.</para>
|
---|
| 28 |
|
---|
| 29 | <segmentedlist>
|
---|
| 30 | <segtitle>&buildtime;</segtitle>
|
---|
| 31 | <segtitle>&diskspace;</segtitle>
|
---|
| 32 |
|
---|
| 33 | <seglistitem>
|
---|
[e4a5635] | 34 | <seg>&sysvinit-ch6-sbu;</seg>
|
---|
| 35 | <seg>&sysvinit-ch6-du;</seg>
|
---|
[ddd5542] | 36 | </seglistitem>
|
---|
| 37 | </segmentedlist>
|
---|
| 38 |
|
---|
| 39 | </sect2>
|
---|
| 40 |
|
---|
| 41 | <sect2 role="installation">
|
---|
| 42 | <title>Installation of Sysvinit</title>
|
---|
| 43 |
|
---|
| 44 | <para>When run-levels are changed (for example, when halting the
|
---|
| 45 | system), <command>init</command> sends termination signals to those
|
---|
| 46 | processes that <command>init</command> itself started and that should
|
---|
| 47 | not be running in the new run-level. While doing this,
|
---|
| 48 | <command>init</command> outputs messages like <quote>Sending processes
|
---|
| 49 | the TERM signal</quote> which seem to imply that it is sending these
|
---|
| 50 | signals to all currently running processes. To avoid this
|
---|
| 51 | misinterpretation, modify the source so that these messages read like
|
---|
[12a2975c] | 52 | <quote>Sending processes configured via /etc/inittab the TERM signal</quote>
|
---|
[ddd5542] | 53 | instead:</para>
|
---|
[73aedd1d] | 54 |
|
---|
[0445a3d] | 55 | <screen><userinput remap="pre">sed -i 's@Sending processes@& configured via /etc/inittab@g' \
|
---|
[2ec4b60] | 56 | src/init.c</userinput></screen>
|
---|
[73aedd1d] | 57 |
|
---|
[ddd5542] | 58 | <para>Compile the package:</para>
|
---|
[73aedd1d] | 59 |
|
---|
[0445a3d] | 60 | <screen><userinput remap="make">make -C src</userinput></screen>
|
---|
[73aedd1d] | 61 |
|
---|
[ddd5542] | 62 | <para>This package does not come with a test suite.</para>
|
---|
[0be3d41] | 63 |
|
---|
[ddd5542] | 64 | <para>Install the package:</para>
|
---|
[73aedd1d] | 65 |
|
---|
[0445a3d] | 66 | <screen><userinput remap="install">make -C src install</userinput></screen>
|
---|
[73aedd1d] | 67 |
|
---|
[ddd5542] | 68 | </sect2>
|
---|
[5888299] | 69 |
|
---|
[ddd5542] | 70 | <sect2 id="conf-sysvinit" role="configuration">
|
---|
| 71 | <title>Configuring Sysvinit</title>
|
---|
[342b176] | 72 |
|
---|
[ddd5542] | 73 | <indexterm zone="conf-sysvinit">
|
---|
| 74 | <primary sortas="a-Sysvinit">Sysvinit</primary>
|
---|
| 75 | <secondary>configuring</secondary>
|
---|
| 76 | </indexterm>
|
---|
[81fd230] | 77 |
|
---|
[ddd5542] | 78 | <indexterm zone="conf-sysvinit">
|
---|
| 79 | <primary sortas="e-/etc/inittab">/etc/inittab</primary>
|
---|
| 80 | </indexterm>
|
---|
[673b0d8] | 81 |
|
---|
[ddd5542] | 82 | <para>Create a new file <filename>/etc/inittab</filename> by running the
|
---|
| 83 | following:</para>
|
---|
[342b176] | 84 |
|
---|
[8ad7980] | 85 | <screen><userinput>cat > /etc/inittab << "EOF"
|
---|
[d72e04a] | 86 | <literal># Begin /etc/inittab
|
---|
[342b176] | 87 |
|
---|
| 88 | id:3:initdefault:
|
---|
| 89 |
|
---|
| 90 | si::sysinit:/etc/rc.d/init.d/rc sysinit
|
---|
| 91 |
|
---|
| 92 | l0:0:wait:/etc/rc.d/init.d/rc 0
|
---|
| 93 | l1:S1:wait:/etc/rc.d/init.d/rc 1
|
---|
| 94 | l2:2:wait:/etc/rc.d/init.d/rc 2
|
---|
| 95 | l3:3:wait:/etc/rc.d/init.d/rc 3
|
---|
| 96 | l4:4:wait:/etc/rc.d/init.d/rc 4
|
---|
| 97 | l5:5:wait:/etc/rc.d/init.d/rc 5
|
---|
| 98 | l6:6:wait:/etc/rc.d/init.d/rc 6
|
---|
| 99 |
|
---|
| 100 | ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
|
---|
| 101 |
|
---|
| 102 | su:S016:once:/sbin/sulogin
|
---|
| 103 |
|
---|
[fa21b3d] | 104 | 1:2345:respawn:/sbin/agetty tty1 9600
|
---|
| 105 | 2:2345:respawn:/sbin/agetty tty2 9600
|
---|
| 106 | 3:2345:respawn:/sbin/agetty tty3 9600
|
---|
| 107 | 4:2345:respawn:/sbin/agetty tty4 9600
|
---|
| 108 | 5:2345:respawn:/sbin/agetty tty5 9600
|
---|
| 109 | 6:2345:respawn:/sbin/agetty tty6 9600
|
---|
[342b176] | 110 |
|
---|
[d72e04a] | 111 | # End /etc/inittab</literal>
|
---|
[8ad7980] | 112 | EOF</userinput></screen>
|
---|
[673b0d8] | 113 |
|
---|
[ddd5542] | 114 | </sect2>
|
---|
| 115 |
|
---|
| 116 | <sect2 id="contents-sysvinit" role="content">
|
---|
| 117 | <title>Contents of Sysvinit</title>
|
---|
| 118 |
|
---|
| 119 | <segmentedlist>
|
---|
| 120 | <segtitle>Installed programs</segtitle>
|
---|
| 121 |
|
---|
| 122 | <seglistitem>
|
---|
[8bc46a5] | 123 | <seg>bootlogd, halt, init, killall5, last, lastb (link to last), mesg,
|
---|
| 124 | mountpoint, pidof (link to killall5), poweroff (link to halt),
|
---|
| 125 | reboot (link to halt), runlevel, shutdown, sulogin,
|
---|
| 126 | telinit (link to init), utmpdump, and wall</seg>
|
---|
[ddd5542] | 127 | </seglistitem>
|
---|
| 128 | </segmentedlist>
|
---|
| 129 |
|
---|
| 130 | <variablelist>
|
---|
| 131 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 132 | <?dbfo list-presentation="list"?>
|
---|
| 133 | <?dbhtml list-presentation="table"?>
|
---|
| 134 |
|
---|
[8bc46a5] | 135 | <varlistentry id="bootlogd">
|
---|
| 136 | <term><command>bootlogd</command></term>
|
---|
| 137 | <listitem>
|
---|
| 138 | <para>Logs boot messages to a log file</para>
|
---|
| 139 | <indexterm zone="ch-system-sysvinit bootlogd">
|
---|
| 140 | <primary sortas="b-bootlogd">bootlogd</primary>
|
---|
| 141 | </indexterm>
|
---|
| 142 | </listitem>
|
---|
| 143 | </varlistentry>
|
---|
| 144 |
|
---|
[ddd5542] | 145 | <varlistentry id="halt">
|
---|
| 146 | <term><command>halt</command></term>
|
---|
| 147 | <listitem>
|
---|
| 148 | <para>Normally invokes <command>shutdown</command> with the
|
---|
| 149 | <parameter>-h</parameter> option, except when already in run-level 0,
|
---|
| 150 | then it tells the kernel to halt the system; it notes in the
|
---|
| 151 | file <filename>/var/log/wtmp</filename> that the system is being
|
---|
| 152 | brought down</para>
|
---|
| 153 | <indexterm zone="ch-system-sysvinit halt">
|
---|
| 154 | <primary sortas="b-halt">halt</primary>
|
---|
| 155 | </indexterm>
|
---|
| 156 | </listitem>
|
---|
| 157 | </varlistentry>
|
---|
| 158 |
|
---|
| 159 | <varlistentry id="init">
|
---|
| 160 | <term><command>init</command></term>
|
---|
| 161 | <listitem>
|
---|
| 162 | <para>The first process to be started when the kernel has initialized
|
---|
| 163 | the hardware which takes over the boot process and starts all the
|
---|
| 164 | proceses it is instructed to</para>
|
---|
| 165 | <indexterm zone="ch-system-sysvinit init">
|
---|
| 166 | <primary sortas="b-init">init</primary>
|
---|
| 167 | </indexterm>
|
---|
| 168 | </listitem>
|
---|
| 169 | </varlistentry>
|
---|
| 170 |
|
---|
| 171 | <varlistentry id="killall5">
|
---|
| 172 | <term><command>killall5</command></term>
|
---|
| 173 | <listitem>
|
---|
| 174 | <para>Sends a signal to all processes, except the processes in its own
|
---|
| 175 | session so it will not kill the shell running the script that called
|
---|
| 176 | it</para>
|
---|
| 177 | <indexterm zone="ch-system-sysvinit killall5">
|
---|
| 178 | <primary sortas="b-killall5">killall5</primary>
|
---|
| 179 | </indexterm>
|
---|
| 180 | </listitem>
|
---|
| 181 | </varlistentry>
|
---|
| 182 |
|
---|
| 183 | <varlistentry id="last">
|
---|
| 184 | <term><command>last</command></term>
|
---|
| 185 | <listitem>
|
---|
| 186 | <para>Shows which users last logged in (and out), searching back
|
---|
| 187 | through the <filename>/var/log/wtmp</filename> file; it also shows
|
---|
| 188 | system boots, shutdowns, and run-level changes</para>
|
---|
| 189 | <indexterm zone="ch-system-sysvinit last">
|
---|
| 190 | <primary sortas="b-last">last</primary>
|
---|
| 191 | </indexterm>
|
---|
| 192 | </listitem>
|
---|
| 193 | </varlistentry>
|
---|
| 194 |
|
---|
| 195 | <varlistentry id="lastb">
|
---|
| 196 | <term><command>lastb</command></term>
|
---|
| 197 | <listitem>
|
---|
| 198 | <para>Shows the failed login attempts, as logged in
|
---|
| 199 | <filename>/var/log/btmp</filename></para>
|
---|
| 200 | <indexterm zone="ch-system-sysvinit lastb">
|
---|
| 201 | <primary sortas="b-lastb">lastb</primary>
|
---|
| 202 | </indexterm>
|
---|
| 203 | </listitem>
|
---|
| 204 | </varlistentry>
|
---|
| 205 |
|
---|
| 206 | <varlistentry id="mesg">
|
---|
| 207 | <term><command>mesg</command></term>
|
---|
| 208 | <listitem>
|
---|
| 209 | <para>Controls whether other users can send messages to the current
|
---|
| 210 | user's terminal</para>
|
---|
| 211 | <indexterm zone="ch-system-sysvinit mesg">
|
---|
| 212 | <primary sortas="b-mesg">mesg</primary>
|
---|
| 213 | </indexterm>
|
---|
| 214 | </listitem>
|
---|
| 215 | </varlistentry>
|
---|
| 216 |
|
---|
| 217 | <varlistentry id="mountpoint">
|
---|
| 218 | <term><command>mountpoint</command></term>
|
---|
| 219 | <listitem>
|
---|
| 220 | <para>Checks if the directory is a mountpoint</para>
|
---|
| 221 | <indexterm zone="ch-system-sysvinit mountpoint">
|
---|
| 222 | <primary sortas="b-mountpoint">mountpoint</primary>
|
---|
| 223 | </indexterm>
|
---|
| 224 | </listitem>
|
---|
| 225 | </varlistentry>
|
---|
| 226 |
|
---|
| 227 | <varlistentry id="pidof">
|
---|
| 228 | <term><command>pidof</command></term>
|
---|
| 229 | <listitem>
|
---|
| 230 | <para>Reports the PIDs of the given programs</para>
|
---|
| 231 | <indexterm zone="ch-system-sysvinit pidof">
|
---|
| 232 | <primary sortas="b-pidof">pidof</primary>
|
---|
| 233 | </indexterm>
|
---|
| 234 | </listitem>
|
---|
| 235 | </varlistentry>
|
---|
| 236 |
|
---|
| 237 | <varlistentry id="poweroff">
|
---|
| 238 | <term><command>poweroff</command></term>
|
---|
| 239 | <listitem>
|
---|
| 240 | <para>Tells the kernel to halt the system and switch off the computer
|
---|
| 241 | (see <command>halt</command>)</para>
|
---|
| 242 | <indexterm zone="ch-system-sysvinit poweroff">
|
---|
| 243 | <primary sortas="b-poweroff">poweroff</primary>
|
---|
| 244 | </indexterm>
|
---|
| 245 | </listitem>
|
---|
| 246 | </varlistentry>
|
---|
| 247 |
|
---|
| 248 | <varlistentry id="reboot">
|
---|
| 249 | <term><command>reboot</command></term>
|
---|
| 250 | <listitem>
|
---|
| 251 | <para>Tells the kernel to reboot the system (see
|
---|
| 252 | <command>halt</command>)</para>
|
---|
| 253 | <indexterm zone="ch-system-sysvinit reboot">
|
---|
| 254 | <primary sortas="b-reboot">reboot</primary>
|
---|
| 255 | </indexterm>
|
---|
| 256 | </listitem>
|
---|
| 257 | </varlistentry>
|
---|
| 258 |
|
---|
| 259 | <varlistentry id="runlevel">
|
---|
| 260 | <term><command>runlevel</command></term>
|
---|
| 261 | <listitem>
|
---|
| 262 | <para>Reports the previous and the current run-level, as noted in the
|
---|
| 263 | last run-level record in <filename>/var/run/utmp</filename></para>
|
---|
| 264 | <indexterm zone="ch-system-sysvinit runlevel">
|
---|
| 265 | <primary sortas="b-runlevel">runlevel</primary>
|
---|
| 266 | </indexterm>
|
---|
| 267 | </listitem>
|
---|
| 268 | </varlistentry>
|
---|
| 269 |
|
---|
| 270 | <varlistentry id="shutdown">
|
---|
| 271 | <term><command>shutdown</command></term>
|
---|
| 272 | <listitem>
|
---|
| 273 | <para>Brings the system down in a secure way, signaling all processes
|
---|
| 274 | and notifying all logged-in users</para>
|
---|
| 275 | <indexterm zone="ch-system-sysvinit shutdown">
|
---|
| 276 | <primary sortas="b-shutdown">shutdown</primary>
|
---|
| 277 | </indexterm>
|
---|
| 278 | </listitem>
|
---|
| 279 | </varlistentry>
|
---|
| 280 |
|
---|
| 281 | <varlistentry id="sulogin">
|
---|
| 282 | <term><command>sulogin</command></term>
|
---|
| 283 | <listitem>
|
---|
| 284 | <para>Allows <systemitem class="username">root</systemitem> to log in;
|
---|
| 285 | it is normally invoked by <command>init</command> when the system goes
|
---|
| 286 | into single user mode</para>
|
---|
| 287 | <indexterm zone="ch-system-sysvinit sulogin">
|
---|
| 288 | <primary sortas="b-sulogin">sulogin</primary>
|
---|
| 289 | </indexterm>
|
---|
| 290 | </listitem>
|
---|
| 291 | </varlistentry>
|
---|
| 292 |
|
---|
| 293 | <varlistentry id="telinit">
|
---|
| 294 | <term><command>telinit</command></term>
|
---|
| 295 | <listitem>
|
---|
| 296 | <para>Tells <command>init</command> which run-level to change to</para>
|
---|
| 297 | <indexterm zone="ch-system-sysvinit telinit">
|
---|
| 298 | <primary sortas="b-telinit">telinit</primary>
|
---|
| 299 | </indexterm>
|
---|
| 300 | </listitem>
|
---|
| 301 | </varlistentry>
|
---|
| 302 |
|
---|
| 303 | <varlistentry id="utmpdump">
|
---|
| 304 | <term><command>utmpdump</command></term>
|
---|
| 305 | <listitem>
|
---|
| 306 | <para>Displays the content of the given login file in a more
|
---|
| 307 | user-friendly format</para>
|
---|
| 308 | <indexterm zone="ch-system-sysvinit utmpdump">
|
---|
| 309 | <primary sortas="b-utmpdump">utmpdump</primary>
|
---|
| 310 | </indexterm>
|
---|
| 311 | </listitem>
|
---|
| 312 | </varlistentry>
|
---|
| 313 |
|
---|
| 314 | <varlistentry id="wall">
|
---|
| 315 | <term><command>wall</command></term>
|
---|
| 316 | <listitem>
|
---|
| 317 | <para>Writes a message to all logged-in users</para>
|
---|
| 318 | <indexterm zone="ch-system-sysvinit wall">
|
---|
| 319 | <primary sortas="b-wall">wall</primary>
|
---|
| 320 | </indexterm>
|
---|
| 321 | </listitem>
|
---|
| 322 | </varlistentry>
|
---|
| 323 |
|
---|
| 324 | </variablelist>
|
---|
| 325 |
|
---|
| 326 | </sect2>
|
---|
[81fd230] | 327 |
|
---|
[ddd5542] | 328 | </sect1>
|
---|