[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
[a001133] | 6 | <sect1 id="ch-system-sysvinit" xreflabel="Sysvinit" role="wrap">
|
---|
[673b0d8] | 7 | <title>Sysvinit-&sysvinit-version;</title>
|
---|
| 8 | <?dbhtml filename="sysvinit.html"?>
|
---|
| 9 |
|
---|
| 10 | <indexterm zone="ch-system-sysvinit"><primary sortas="a-Sysvinit">Sysvinit</primary></indexterm>
|
---|
[6370fa6] | 11 |
|
---|
[a001133] | 12 | <sect2 role="package"><title/>
|
---|
[5888299] | 13 | <para>The Sysvinit package contains programs for controlling the startup,
|
---|
| 14 | running, and shutdown of your system.</para>
|
---|
| 15 |
|
---|
[a001133] | 16 | <segmentedlist>
|
---|
| 17 | <segtitle>&buildtime;</segtitle>
|
---|
| 18 | <segtitle>&diskspace;</segtitle>
|
---|
| 19 | <seglistitem><seg>0.1 SBU</seg><seg> 0.9 MB</seg></seglistitem>
|
---|
| 20 | </segmentedlist>
|
---|
[673b0d8] | 21 |
|
---|
[a001133] | 22 | <segmentedlist>
|
---|
| 23 | <segtitle>Sysvinit installation depends on</segtitle>
|
---|
| 24 | <seglistitem><seg>Binutils, Coreutils, GCC, Glibc, Make</seg></seglistitem>
|
---|
| 25 | </segmentedlist>
|
---|
| 26 | </sect2>
|
---|
[3554fa3a] | 27 |
|
---|
[a001133] | 28 | <sect2 role="installation">
|
---|
[73aedd1d] | 29 | <title>Installation of Sysvinit</title>
|
---|
| 30 |
|
---|
[ef13657] | 31 | <para>Sysvinit-&sysvinit-version; contains a <quote>buffer
|
---|
| 32 | overflow</quote> bug. Under some conditions, it modifies the values of
|
---|
| 33 | environment variables. Fix this with:</para>
|
---|
[8ad7980] | 34 |
|
---|
[456a1d92] | 35 | <screen><userinput>patch -Np1 -i ../sysvinit-&sysvinit-version;-proclen-1.patch</userinput></screen>
|
---|
[8ad7980] | 36 |
|
---|
[ef13657] | 37 | <para>When run-levels are changed (for example, when halting the
|
---|
| 38 | system), <command>init</command> sends termination signals to those
|
---|
| 39 | processes that <command>init</command> itself started and that should
|
---|
| 40 | not be running in the new run-level. While doing this,
|
---|
| 41 | <command>init</command> outputs messages like <quote>Sending processes
|
---|
| 42 | the TERM signal</quote> which seem to imply that it is sending these
|
---|
| 43 | signals to all currently running processes. To avoid this
|
---|
| 44 | misinterpretation, modify the source so that these messages read like
|
---|
| 45 | <quote>Sending processes started by init the TERM signal</quote>
|
---|
| 46 | instead:</para>
|
---|
[73aedd1d] | 47 |
|
---|
[2ec4b60] | 48 | <screen><userinput>sed -i 's@Sending processes@& started by init@g' \
|
---|
| 49 | src/init.c</userinput></screen>
|
---|
[73aedd1d] | 50 |
|
---|
| 51 | <para>Compile Sysvinit:</para>
|
---|
| 52 |
|
---|
| 53 | <screen><userinput>make -C src</userinput></screen>
|
---|
| 54 |
|
---|
[ef13657] | 55 | <para>Install the package:</para>
|
---|
[73aedd1d] | 56 |
|
---|
| 57 | <screen><userinput>make -C src install</userinput></screen>
|
---|
| 58 |
|
---|
| 59 | </sect2>
|
---|
[5888299] | 60 |
|
---|
[342b176] | 61 |
|
---|
[df8334f] | 62 | <sect2 id="conf-sysvinit" role="configuration"><title>Configuring Sysvinit</title>
|
---|
[673b0d8] | 63 | <indexterm zone="conf-sysvinit">
|
---|
| 64 | <primary sortas="a-Sysvinit">Sysvinit</primary>
|
---|
| 65 | <secondary>configuring</secondary></indexterm>
|
---|
| 66 |
|
---|
| 67 | <indexterm zone="conf-sysvinit"><primary sortas="e-/etc/inittab">/etc/inittab</primary></indexterm>
|
---|
[342b176] | 68 |
|
---|
[ef13657] | 69 | <para>Create a new file <filename>/etc/inittab</filename> by running the
|
---|
[342b176] | 70 | following:</para>
|
---|
| 71 |
|
---|
[8ad7980] | 72 | <screen><userinput>cat > /etc/inittab << "EOF"
|
---|
[342b176] | 73 | # Begin /etc/inittab
|
---|
| 74 |
|
---|
| 75 | id:3:initdefault:
|
---|
| 76 |
|
---|
| 77 | si::sysinit:/etc/rc.d/init.d/rc sysinit
|
---|
| 78 |
|
---|
| 79 | l0:0:wait:/etc/rc.d/init.d/rc 0
|
---|
| 80 | l1:S1:wait:/etc/rc.d/init.d/rc 1
|
---|
| 81 | l2:2:wait:/etc/rc.d/init.d/rc 2
|
---|
| 82 | l3:3:wait:/etc/rc.d/init.d/rc 3
|
---|
| 83 | l4:4:wait:/etc/rc.d/init.d/rc 4
|
---|
| 84 | l5:5:wait:/etc/rc.d/init.d/rc 5
|
---|
| 85 | l6:6:wait:/etc/rc.d/init.d/rc 6
|
---|
| 86 |
|
---|
| 87 | ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
|
---|
| 88 |
|
---|
| 89 | su:S016:once:/sbin/sulogin
|
---|
| 90 |
|
---|
[b32e803] | 91 | 1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
|
---|
| 92 | 2:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
|
---|
| 93 | 3:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
|
---|
| 94 | 4:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
|
---|
| 95 | 5:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
|
---|
| 96 | 6:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600
|
---|
[342b176] | 97 |
|
---|
| 98 | # End /etc/inittab
|
---|
[8ad7980] | 99 | EOF</userinput></screen>
|
---|
[342b176] | 100 |
|
---|
[ef13657] | 101 | <para>The <parameter>-I '\033(K'</parameter> option tells
|
---|
| 102 | <command>agetty</command> to send this escape sequence to the terminal
|
---|
| 103 | before doing anything else. This escape sequence switches the console
|
---|
| 104 | character set to a user-defined one, which can be modified by running
|
---|
| 105 | the <command>setfont</command> program. The console initscript from
|
---|
| 106 | the LFS-Bootscripts package calls the <command>setfont</command>
|
---|
| 107 | program during system startup. Sending this escape sequence is
|
---|
| 108 | necessary for people who use non-ISO-8859-1 screen fonts, but it does
|
---|
| 109 | not affect native English speakers.</para>
|
---|
[b32e803] | 110 |
|
---|
[342b176] | 111 | </sect2>
|
---|
[5888299] | 112 |
|
---|
| 113 |
|
---|
[c6cb3aa] | 114 | <sect2 id="contents-sysvinit" role="content"><title>Contents of Sysvinit</title>
|
---|
[673b0d8] | 115 |
|
---|
[c6cb3aa] | 116 | <segmentedlist>
|
---|
| 117 | <segtitle>Installed programs</segtitle>
|
---|
| 118 | <seglistitem><seg>halt, init, killall5, last, lastb (link to last), mesg, pidof (link to
|
---|
| 119 | killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit
|
---|
| 120 | (link to init), utmpdump and wall</seg></seglistitem>
|
---|
| 121 | </segmentedlist>
|
---|
[673b0d8] | 122 |
|
---|
[c6cb3aa] | 123 | <variablelist><title>Short descriptions</title>
|
---|
[673b0d8] | 124 |
|
---|
[b8a819f] | 125 | <varlistentry id="halt">
|
---|
| 126 | <term><command>halt</command></term>
|
---|
[c6cb3aa] | 127 | <listitem>
|
---|
[673b0d8] | 128 | <indexterm zone="ch-system-sysvinit halt"><primary sortas="b-halt">halt</primary></indexterm>
|
---|
[ef13657] | 129 | <para>normally invokes <command>shutdown</command> with the
|
---|
| 130 | <parameter>-h</parameter> option, except when already in run-level 0,
|
---|
| 131 | then it tells the kernel to halt the system. First it notes in the
|
---|
| 132 | file <filename>/var/log/wtmp</filename> that the system is being
|
---|
| 133 | brought down.</para>
|
---|
[c6cb3aa] | 134 | </listitem>
|
---|
| 135 | </varlistentry>
|
---|
[673b0d8] | 136 |
|
---|
[b8a819f] | 137 | <varlistentry id="init">
|
---|
| 138 | <term><command>init</command></term>
|
---|
[c6cb3aa] | 139 | <listitem>
|
---|
[673b0d8] | 140 | <indexterm zone="ch-system-sysvinit init"><primary sortas="b-init">init</primary></indexterm>
|
---|
[ef13657] | 141 | <para>the first process to be started when the kernel has initialized
|
---|
| 142 | the hardware. Init takes over the boot process and starts all the
|
---|
| 143 | proceses it is instructed to.</para>
|
---|
[c6cb3aa] | 144 | </listitem>
|
---|
| 145 | </varlistentry>
|
---|
[673b0d8] | 146 |
|
---|
[b8a819f] | 147 | <varlistentry id="killall5">
|
---|
| 148 | <term><command>killall5</command></term>
|
---|
[c6cb3aa] | 149 | <listitem>
|
---|
[673b0d8] | 150 | <indexterm zone="ch-system-sysvinit killall5"><primary sortas="b-killall5">killall5</primary></indexterm>
|
---|
[ef13657] | 151 | <para>sends a signal to all processes, except the processes in its own
|
---|
| 152 | session so it won't kill the shell running the script that called
|
---|
| 153 | it.</para>
|
---|
[c6cb3aa] | 154 | </listitem>
|
---|
| 155 | </varlistentry>
|
---|
| 156 |
|
---|
[b8a819f] | 157 | <varlistentry id="last">
|
---|
| 158 | <term><command>last</command></term>
|
---|
[c6cb3aa] | 159 | <listitem>
|
---|
[673b0d8] | 160 | <indexterm zone="ch-system-sysvinit last"><primary sortas="b-last">last</primary></indexterm>
|
---|
[c6cb3aa] | 161 | <para>shows which users last logged in (and out),
|
---|
[ef13657] | 162 | searching back through the <filename>/var/log/wtmp</filename> file. It
|
---|
| 163 | also show system boots, shutdowns, and run-level changes.</para>
|
---|
[c6cb3aa] | 164 | </listitem>
|
---|
| 165 | </varlistentry>
|
---|
[673b0d8] | 166 |
|
---|
[b8a819f] | 167 | <varlistentry id="lastb">
|
---|
| 168 | <term><command>lastb</command></term>
|
---|
[c6cb3aa] | 169 | <listitem>
|
---|
[673b0d8] | 170 | <indexterm zone="ch-system-sysvinit lastb"><primary sortas="b-lastb">lastb</primary></indexterm>
|
---|
[ef13657] | 171 | <para>shows the failed login attempts, as logged in
|
---|
[c6cb3aa] | 172 | <filename>/var/log/btmp</filename>.</para>
|
---|
| 173 | </listitem>
|
---|
| 174 | </varlistentry>
|
---|
| 175 |
|
---|
[b8a819f] | 176 | <varlistentry id="mesg">
|
---|
| 177 | <term><command>mesg</command></term>
|
---|
[c6cb3aa] | 178 | <listitem>
|
---|
[673b0d8] | 179 | <indexterm zone="ch-system-sysvinit mesg"><primary sortas="b-mesg">mesg</primary></indexterm>
|
---|
[ef13657] | 180 | <para>controls whether other users can send messages to the current
|
---|
| 181 | user's terminal.</para>
|
---|
[c6cb3aa] | 182 | </listitem>
|
---|
| 183 | </varlistentry>
|
---|
[73aedd1d] | 184 |
|
---|
[b8a819f] | 185 | <varlistentry id="pidof">
|
---|
| 186 | <term><command>pidof</command></term>
|
---|
[c6cb3aa] | 187 | <listitem>
|
---|
[673b0d8] | 188 | <indexterm zone="ch-system-sysvinit pidof"><primary sortas="b-pidof">pidof</primary></indexterm>
|
---|
[c6cb3aa] | 189 | <para>reports the PIDs of the given programs.</para>
|
---|
| 190 | </listitem>
|
---|
| 191 | </varlistentry>
|
---|
[673b0d8] | 192 |
|
---|
[b8a819f] | 193 | <varlistentry id="poweroff">
|
---|
| 194 | <term><command>poweroff</command></term>
|
---|
[c6cb3aa] | 195 | <listitem>
|
---|
[673b0d8] | 196 | <indexterm zone="ch-system-sysvinit poweroff"><primary sortas="b-poweroff">poweroff</primary></indexterm>
|
---|
[ef13657] | 197 | <para>tells the kernel to halt the system and switch off the computer
|
---|
| 198 | (see <command>halt</command>).</para>
|
---|
[c6cb3aa] | 199 | </listitem>
|
---|
| 200 | </varlistentry>
|
---|
[673b0d8] | 201 |
|
---|
[b8a819f] | 202 | <varlistentry id="reboot">
|
---|
| 203 | <term><command>reboot</command></term>
|
---|
[c6cb3aa] | 204 | <listitem>
|
---|
[673b0d8] | 205 | <indexterm zone="ch-system-sysvinit reboot"><primary sortas="b-reboot">reboot</primary></indexterm>
|
---|
[ef13657] | 206 | <para>tells the kernel to reboot the system (see
|
---|
| 207 | <command>halt</command>).</para>
|
---|
[c6cb3aa] | 208 | </listitem>
|
---|
| 209 | </varlistentry>
|
---|
[673b0d8] | 210 |
|
---|
[b8a819f] | 211 | <varlistentry id="runlevel">
|
---|
| 212 | <term><command>runlevel</command></term>
|
---|
[c6cb3aa] | 213 | <listitem>
|
---|
[673b0d8] | 214 | <indexterm zone="ch-system-sysvinit runlevel"><primary sortas="b-runlevel">runlevel</primary></indexterm>
|
---|
[c6cb3aa] | 215 | <para>reports the previous and the current run-level, as noted in the last run-level
|
---|
| 216 | record in <filename>/var/run/utmp</filename>.</para>
|
---|
| 217 | </listitem>
|
---|
| 218 | </varlistentry>
|
---|
| 219 |
|
---|
[b8a819f] | 220 | <varlistentry id="shutdown">
|
---|
| 221 | <term><command>shutdown</command></term>
|
---|
[c6cb3aa] | 222 | <listitem>
|
---|
[673b0d8] | 223 | <indexterm zone="ch-system-sysvinit shutdown"><primary sortas="b-shutdown">shutdown</primary></indexterm>
|
---|
[ef13657] | 224 | <para>brings the system down in a secure way, signaling all processes
|
---|
| 225 | and notifying all logged-in users.</para>
|
---|
[c6cb3aa] | 226 | </listitem>
|
---|
| 227 | </varlistentry>
|
---|
[673b0d8] | 228 |
|
---|
[b8a819f] | 229 | <varlistentry id="sulogin">
|
---|
| 230 | <term><command>sulogin</command></term>
|
---|
[c6cb3aa] | 231 | <listitem>
|
---|
[673b0d8] | 232 | <indexterm zone="ch-system-sysvinit sulogin"><primary sortas="b-sulogin">sulogin</primary></indexterm>
|
---|
[ef13657] | 233 | <para>allows <emphasis>root</emphasis> to log in. It is
|
---|
[8ad7980] | 234 | normally invoked by <command>init</command> when the system goes into single user mode.</para>
|
---|
[c6cb3aa] | 235 | </listitem>
|
---|
| 236 | </varlistentry>
|
---|
[673b0d8] | 237 |
|
---|
[b8a819f] | 238 | <varlistentry id="telinit">
|
---|
| 239 | <term><command>telinit</command></term>
|
---|
[c6cb3aa] | 240 | <listitem>
|
---|
[673b0d8] | 241 | <indexterm zone="ch-system-sysvinit telinit"><primary sortas="b-telinit">telinit</primary></indexterm>
|
---|
[ef13657] | 242 | <para>tells <command>init</command> which run-level to change to.</para>
|
---|
[c6cb3aa] | 243 | </listitem>
|
---|
| 244 | </varlistentry>
|
---|
[673b0d8] | 245 |
|
---|
[b8a819f] | 246 | <varlistentry id="utmpdump">
|
---|
| 247 | <term><command>utmpdump</command></term>
|
---|
[c6cb3aa] | 248 | <listitem>
|
---|
[673b0d8] | 249 | <indexterm zone="ch-system-sysvinit utmpdump"><primary sortas="b-utmpdump">utmpdump</primary></indexterm>
|
---|
[ef13657] | 250 | <para>displays the content of the given login file in a more
|
---|
| 251 | user-friedly format.</para>
|
---|
[c6cb3aa] | 252 | </listitem>
|
---|
| 253 | </varlistentry>
|
---|
[673b0d8] | 254 |
|
---|
[b8a819f] | 255 | <varlistentry id="wall">
|
---|
| 256 | <term><command>wall</command></term>
|
---|
[c6cb3aa] | 257 | <listitem>
|
---|
[673b0d8] | 258 | <indexterm zone="ch-system-sysvinit wall"><primary sortas="b-wall">wall</primary></indexterm>
|
---|
[c6cb3aa] | 259 | <para>writes a message to all logged-in users.</para>
|
---|
| 260 | </listitem>
|
---|
| 261 | </varlistentry>
|
---|
| 262 | </variablelist>
|
---|
[673b0d8] | 263 |
|
---|
| 264 | </sect2>
|
---|
| 265 |
|
---|
| 266 | </sect1>
|
---|
[ef13657] | 267 |
|
---|