[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 | ]>
|
---|
[752f4e5] | 6 | <sect1 id="ch-system-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,
|
---|
[69993f4] | 14 | running, and shutdown of the system.</para>
|
---|
[5888299] | 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>
|
---|
[69993f4] | 24 | <seglistitem><seg>Binutils, Coreutils, GCC, Glibc, and Make</seg></seglistitem>
|
---|
[a001133] | 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"
|
---|
[3890f5a] | 73 | <literal># Begin /etc/inittab
|
---|
[342b176] | 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 |
|
---|
[3890f5a] | 98 | # End /etc/inittab</literal>
|
---|
[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
|
---|
[69993f4] | 108 | necessary for people who use non-ISO 8859-1 screen fonts, but it does
|
---|
[ef13657] | 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
|
---|
[69993f4] | 120 | (link to init), utmpdump, and wall</seg></seglistitem>
|
---|
[c6cb3aa] | 121 | </segmentedlist>
|
---|
[673b0d8] | 122 |
|
---|
[3ed279f] | 123 | <variablelist><bridgehead renderas="sect3">Short descriptions</bridgehead>
|
---|
| 124 | <?dbfo list-presentation="list"?>
|
---|
[673b0d8] | 125 |
|
---|
[b8a819f] | 126 | <varlistentry id="halt">
|
---|
| 127 | <term><command>halt</command></term>
|
---|
[c6cb3aa] | 128 | <listitem>
|
---|
[ef13657] | 129 | <para>normally invokes <command>shutdown</command> with the
|
---|
| 130 | <parameter>-h</parameter> option, except when already in run-level 0,
|
---|
[69993f4] | 131 | then it tells the kernel to halt the system. It notes in the
|
---|
[ef13657] | 132 | file <filename>/var/log/wtmp</filename> that the system is being
|
---|
| 133 | brought down.</para>
|
---|
[3ed279f] | 134 | <indexterm zone="ch-system-sysvinit halt"><primary sortas="b-halt">halt</primary></indexterm>
|
---|
[c6cb3aa] | 135 | </listitem>
|
---|
| 136 | </varlistentry>
|
---|
[673b0d8] | 137 |
|
---|
[b8a819f] | 138 | <varlistentry id="init">
|
---|
| 139 | <term><command>init</command></term>
|
---|
[c6cb3aa] | 140 | <listitem>
|
---|
[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>
|
---|
[3ed279f] | 144 | <indexterm zone="ch-system-sysvinit init"><primary sortas="b-init">init</primary></indexterm>
|
---|
[c6cb3aa] | 145 | </listitem>
|
---|
| 146 | </varlistentry>
|
---|
[673b0d8] | 147 |
|
---|
[b8a819f] | 148 | <varlistentry id="killall5">
|
---|
| 149 | <term><command>killall5</command></term>
|
---|
[c6cb3aa] | 150 | <listitem>
|
---|
[ef13657] | 151 | <para>sends a signal to all processes, except the processes in its own
|
---|
[69993f4] | 152 | session so it will not kill the shell running the script that called
|
---|
[ef13657] | 153 | it.</para>
|
---|
[3ed279f] | 154 | <indexterm zone="ch-system-sysvinit killall5"><primary sortas="b-killall5">killall5</primary></indexterm>
|
---|
[c6cb3aa] | 155 | </listitem>
|
---|
| 156 | </varlistentry>
|
---|
| 157 |
|
---|
[b8a819f] | 158 | <varlistentry id="last">
|
---|
| 159 | <term><command>last</command></term>
|
---|
[c6cb3aa] | 160 | <listitem>
|
---|
| 161 | <para>shows which users last logged in (and out),
|
---|
[ef13657] | 162 | searching back through the <filename>/var/log/wtmp</filename> file. It
|
---|
[69993f4] | 163 | also shows system boots, shutdowns, and run-level changes.</para>
|
---|
[3ed279f] | 164 | <indexterm zone="ch-system-sysvinit last"><primary sortas="b-last">last</primary></indexterm>
|
---|
[c6cb3aa] | 165 | </listitem>
|
---|
| 166 | </varlistentry>
|
---|
[673b0d8] | 167 |
|
---|
[b8a819f] | 168 | <varlistentry id="lastb">
|
---|
| 169 | <term><command>lastb</command></term>
|
---|
[c6cb3aa] | 170 | <listitem>
|
---|
[ef13657] | 171 | <para>shows the failed login attempts, as logged in
|
---|
[c6cb3aa] | 172 | <filename>/var/log/btmp</filename>.</para>
|
---|
[3ed279f] | 173 | <indexterm zone="ch-system-sysvinit lastb"><primary sortas="b-lastb">lastb</primary></indexterm>
|
---|
[c6cb3aa] | 174 | </listitem>
|
---|
| 175 | </varlistentry>
|
---|
| 176 |
|
---|
[b8a819f] | 177 | <varlistentry id="mesg">
|
---|
| 178 | <term><command>mesg</command></term>
|
---|
[c6cb3aa] | 179 | <listitem>
|
---|
[ef13657] | 180 | <para>controls whether other users can send messages to the current
|
---|
| 181 | user's terminal.</para>
|
---|
[3ed279f] | 182 | <indexterm zone="ch-system-sysvinit mesg"><primary sortas="b-mesg">mesg</primary></indexterm>
|
---|
[c6cb3aa] | 183 | </listitem>
|
---|
| 184 | </varlistentry>
|
---|
[73aedd1d] | 185 |
|
---|
[b8a819f] | 186 | <varlistentry id="pidof">
|
---|
| 187 | <term><command>pidof</command></term>
|
---|
[c6cb3aa] | 188 | <listitem>
|
---|
| 189 | <para>reports the PIDs of the given programs.</para>
|
---|
[3ed279f] | 190 | <indexterm zone="ch-system-sysvinit pidof"><primary sortas="b-pidof">pidof</primary></indexterm>
|
---|
[c6cb3aa] | 191 | </listitem>
|
---|
| 192 | </varlistentry>
|
---|
[673b0d8] | 193 |
|
---|
[b8a819f] | 194 | <varlistentry id="poweroff">
|
---|
| 195 | <term><command>poweroff</command></term>
|
---|
[c6cb3aa] | 196 | <listitem>
|
---|
[ef13657] | 197 | <para>tells the kernel to halt the system and switch off the computer
|
---|
| 198 | (see <command>halt</command>).</para>
|
---|
[3ed279f] | 199 | <indexterm zone="ch-system-sysvinit poweroff"><primary sortas="b-poweroff">poweroff</primary></indexterm>
|
---|
[c6cb3aa] | 200 | </listitem>
|
---|
| 201 | </varlistentry>
|
---|
[673b0d8] | 202 |
|
---|
[b8a819f] | 203 | <varlistentry id="reboot">
|
---|
| 204 | <term><command>reboot</command></term>
|
---|
[c6cb3aa] | 205 | <listitem>
|
---|
[ef13657] | 206 | <para>tells the kernel to reboot the system (see
|
---|
| 207 | <command>halt</command>).</para>
|
---|
[3ed279f] | 208 | <indexterm zone="ch-system-sysvinit reboot"><primary sortas="b-reboot">reboot</primary></indexterm>
|
---|
[c6cb3aa] | 209 | </listitem>
|
---|
| 210 | </varlistentry>
|
---|
[673b0d8] | 211 |
|
---|
[b8a819f] | 212 | <varlistentry id="runlevel">
|
---|
| 213 | <term><command>runlevel</command></term>
|
---|
[c6cb3aa] | 214 | <listitem>
|
---|
| 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>
|
---|
[3ed279f] | 217 | <indexterm zone="ch-system-sysvinit runlevel"><primary sortas="b-runlevel">runlevel</primary></indexterm>
|
---|
[c6cb3aa] | 218 | </listitem>
|
---|
| 219 | </varlistentry>
|
---|
| 220 |
|
---|
[b8a819f] | 221 | <varlistentry id="shutdown">
|
---|
| 222 | <term><command>shutdown</command></term>
|
---|
[c6cb3aa] | 223 | <listitem>
|
---|
[ef13657] | 224 | <para>brings the system down in a secure way, signaling all processes
|
---|
| 225 | and notifying all logged-in users.</para>
|
---|
[3ed279f] | 226 | <indexterm zone="ch-system-sysvinit shutdown"><primary sortas="b-shutdown">shutdown</primary></indexterm>
|
---|
[c6cb3aa] | 227 | </listitem>
|
---|
| 228 | </varlistentry>
|
---|
[673b0d8] | 229 |
|
---|
[b8a819f] | 230 | <varlistentry id="sulogin">
|
---|
| 231 | <term><command>sulogin</command></term>
|
---|
[c6cb3aa] | 232 | <listitem>
|
---|
[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>
|
---|
[3ed279f] | 235 | <indexterm zone="ch-system-sysvinit sulogin"><primary sortas="b-sulogin">sulogin</primary></indexterm>
|
---|
[c6cb3aa] | 236 | </listitem>
|
---|
| 237 | </varlistentry>
|
---|
[673b0d8] | 238 |
|
---|
[b8a819f] | 239 | <varlistentry id="telinit">
|
---|
| 240 | <term><command>telinit</command></term>
|
---|
[c6cb3aa] | 241 | <listitem>
|
---|
[ef13657] | 242 | <para>tells <command>init</command> which run-level to change to.</para>
|
---|
[3ed279f] | 243 | <indexterm zone="ch-system-sysvinit telinit"><primary sortas="b-telinit">telinit</primary></indexterm>
|
---|
[c6cb3aa] | 244 | </listitem>
|
---|
| 245 | </varlistentry>
|
---|
[673b0d8] | 246 |
|
---|
[b8a819f] | 247 | <varlistentry id="utmpdump">
|
---|
| 248 | <term><command>utmpdump</command></term>
|
---|
[c6cb3aa] | 249 | <listitem>
|
---|
[ef13657] | 250 | <para>displays the content of the given login file in a more
|
---|
[69993f4] | 251 | user-friendly format.</para>
|
---|
[3ed279f] | 252 | <indexterm zone="ch-system-sysvinit utmpdump"><primary sortas="b-utmpdump">utmpdump</primary></indexterm>
|
---|
[c6cb3aa] | 253 | </listitem>
|
---|
| 254 | </varlistentry>
|
---|
[673b0d8] | 255 |
|
---|
[b8a819f] | 256 | <varlistentry id="wall">
|
---|
| 257 | <term><command>wall</command></term>
|
---|
[c6cb3aa] | 258 | <listitem>
|
---|
| 259 | <para>writes a message to all logged-in users.</para>
|
---|
[3ed279f] | 260 | <indexterm zone="ch-system-sysvinit wall"><primary sortas="b-wall">wall</primary></indexterm>
|
---|
[c6cb3aa] | 261 | </listitem>
|
---|
| 262 | </varlistentry>
|
---|
| 263 | </variablelist>
|
---|
[673b0d8] | 264 |
|
---|
| 265 | </sect2>
|
---|
| 266 |
|
---|
| 267 | </sect1>
|
---|
[ef13657] | 268 |
|
---|