[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 |
|
---|
[2256873] | 51 | <para>Compile the package:</para>
|
---|
[73aedd1d] | 52 |
|
---|
[83865af] | 53 | <screen arch="x86"><userinput>make -C src</userinput></screen>
|
---|
| 54 |
|
---|
| 55 | <screen arch="raq2"><userinput>make -C src clobber
|
---|
| 56 | make -C src</userinput></screen>
|
---|
[73aedd1d] | 57 |
|
---|
[ef13657] | 58 | <para>Install the package:</para>
|
---|
[73aedd1d] | 59 |
|
---|
| 60 | <screen><userinput>make -C src install</userinput></screen>
|
---|
| 61 |
|
---|
[0e9a9e2] | 62 | <beginpage/>
|
---|
[73aedd1d] | 63 | </sect2>
|
---|
[5888299] | 64 |
|
---|
[342b176] | 65 |
|
---|
[df8334f] | 66 | <sect2 id="conf-sysvinit" role="configuration"><title>Configuring Sysvinit</title>
|
---|
[673b0d8] | 67 | <indexterm zone="conf-sysvinit">
|
---|
| 68 | <primary sortas="a-Sysvinit">Sysvinit</primary>
|
---|
| 69 | <secondary>configuring</secondary></indexterm>
|
---|
| 70 |
|
---|
| 71 | <indexterm zone="conf-sysvinit"><primary sortas="e-/etc/inittab">/etc/inittab</primary></indexterm>
|
---|
[342b176] | 72 |
|
---|
[ef13657] | 73 | <para>Create a new file <filename>/etc/inittab</filename> by running the
|
---|
[342b176] | 74 | following:</para>
|
---|
| 75 |
|
---|
[8ad7980] | 76 | <screen><userinput>cat > /etc/inittab << "EOF"
|
---|
[3890f5a] | 77 | <literal># Begin /etc/inittab
|
---|
[342b176] | 78 |
|
---|
| 79 | id:3:initdefault:
|
---|
| 80 |
|
---|
| 81 | si::sysinit:/etc/rc.d/init.d/rc sysinit
|
---|
| 82 |
|
---|
| 83 | l0:0:wait:/etc/rc.d/init.d/rc 0
|
---|
| 84 | l1:S1:wait:/etc/rc.d/init.d/rc 1
|
---|
| 85 | l2:2:wait:/etc/rc.d/init.d/rc 2
|
---|
| 86 | l3:3:wait:/etc/rc.d/init.d/rc 3
|
---|
| 87 | l4:4:wait:/etc/rc.d/init.d/rc 4
|
---|
| 88 | l5:5:wait:/etc/rc.d/init.d/rc 5
|
---|
| 89 | l6:6:wait:/etc/rc.d/init.d/rc 6
|
---|
| 90 |
|
---|
| 91 | ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
|
---|
| 92 |
|
---|
[83865af] | 93 | su:S016:once:/sbin/sulogin</literal>
|
---|
[342b176] | 94 |
|
---|
[83865af] | 95 | <literal arch="x86">1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
|
---|
[b32e803] | 96 | 2:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
|
---|
| 97 | 3:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
|
---|
| 98 | 4:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
|
---|
| 99 | 5:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
|
---|
[83865af] | 100 | 6:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600</literal>
|
---|
| 101 |
|
---|
| 102 | <literal arch="raq2">c0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100</literal>
|
---|
[342b176] | 103 |
|
---|
[83865af] | 104 | <literal># End /etc/inittab</literal>
|
---|
[8ad7980] | 105 | EOF</userinput></screen>
|
---|
[342b176] | 106 |
|
---|
[83865af] | 107 | <para arch="x86">The <parameter>-I '\033(K'</parameter> option tells
|
---|
[ef13657] | 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
|
---|
[83c6411] | 111 | the <command>setfont</command> program. The <command>console</command>
|
---|
| 112 | initscript from the LFS-Bootscripts package calls the <command>setfont</command>
|
---|
[ef13657] | 113 | program during system startup. Sending this escape sequence is
|
---|
[69993f4] | 114 | necessary for people who use non-ISO 8859-1 screen fonts, but it does
|
---|
[4ea4bc4] | 115 | not effect native English speakers.</para>
|
---|
[b32e803] | 116 |
|
---|
[0e9a9e2] | 117 | <beginpage/>
|
---|
[342b176] | 118 | </sect2>
|
---|
[5888299] | 119 |
|
---|
| 120 |
|
---|
[c6cb3aa] | 121 | <sect2 id="contents-sysvinit" role="content"><title>Contents of Sysvinit</title>
|
---|
[673b0d8] | 122 |
|
---|
[c6cb3aa] | 123 | <segmentedlist>
|
---|
| 124 | <segtitle>Installed programs</segtitle>
|
---|
| 125 | <seglistitem><seg>halt, init, killall5, last, lastb (link to last), mesg, pidof (link to
|
---|
| 126 | killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit
|
---|
[69993f4] | 127 | (link to init), utmpdump, and wall</seg></seglistitem>
|
---|
[c6cb3aa] | 128 | </segmentedlist>
|
---|
[673b0d8] | 129 |
|
---|
[2256873] | 130 | <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
[3ed279f] | 131 | <?dbfo list-presentation="list"?>
|
---|
[673b0d8] | 132 |
|
---|
[b8a819f] | 133 | <varlistentry id="halt">
|
---|
| 134 | <term><command>halt</command></term>
|
---|
[c6cb3aa] | 135 | <listitem>
|
---|
[2256873] | 136 | <para>Normally invokes <command>shutdown</command> with the
|
---|
[ef13657] | 137 | <parameter>-h</parameter> option, except when already in run-level 0,
|
---|
[2256873] | 138 | then it tells the kernel to halt the system; it notes in the
|
---|
[ef13657] | 139 | file <filename>/var/log/wtmp</filename> that the system is being
|
---|
[2256873] | 140 | brought down</para>
|
---|
[3ed279f] | 141 | <indexterm zone="ch-system-sysvinit halt"><primary sortas="b-halt">halt</primary></indexterm>
|
---|
[c6cb3aa] | 142 | </listitem>
|
---|
| 143 | </varlistentry>
|
---|
[673b0d8] | 144 |
|
---|
[b8a819f] | 145 | <varlistentry id="init">
|
---|
| 146 | <term><command>init</command></term>
|
---|
[c6cb3aa] | 147 | <listitem>
|
---|
[2256873] | 148 | <para>The first process to be started when the kernel has initialized
|
---|
| 149 | the hardware which takes over the boot process and
|
---|
| 150 | starts all the proceses it is instructed to</para>
|
---|
[3ed279f] | 151 | <indexterm zone="ch-system-sysvinit init"><primary sortas="b-init">init</primary></indexterm>
|
---|
[c6cb3aa] | 152 | </listitem>
|
---|
| 153 | </varlistentry>
|
---|
[673b0d8] | 154 |
|
---|
[b8a819f] | 155 | <varlistentry id="killall5">
|
---|
| 156 | <term><command>killall5</command></term>
|
---|
[c6cb3aa] | 157 | <listitem>
|
---|
[2256873] | 158 | <para>Sends a signal to all processes, except the processes in its own
|
---|
[69993f4] | 159 | session so it will not kill the shell running the script that called
|
---|
[2256873] | 160 | it</para>
|
---|
[3ed279f] | 161 | <indexterm zone="ch-system-sysvinit killall5"><primary sortas="b-killall5">killall5</primary></indexterm>
|
---|
[c6cb3aa] | 162 | </listitem>
|
---|
| 163 | </varlistentry>
|
---|
| 164 |
|
---|
[b8a819f] | 165 | <varlistentry id="last">
|
---|
| 166 | <term><command>last</command></term>
|
---|
[c6cb3aa] | 167 | <listitem>
|
---|
[2256873] | 168 | <para>Shows which users last logged in (and out),
|
---|
| 169 | searching back through the <filename>/var/log/wtmp</filename> file; it
|
---|
| 170 | also shows system boots, shutdowns, and run-level changes</para>
|
---|
[3ed279f] | 171 | <indexterm zone="ch-system-sysvinit last"><primary sortas="b-last">last</primary></indexterm>
|
---|
[c6cb3aa] | 172 | </listitem>
|
---|
| 173 | </varlistentry>
|
---|
[673b0d8] | 174 |
|
---|
[b8a819f] | 175 | <varlistentry id="lastb">
|
---|
| 176 | <term><command>lastb</command></term>
|
---|
[c6cb3aa] | 177 | <listitem>
|
---|
[2256873] | 178 | <para>Shows the failed login attempts, as logged in
|
---|
| 179 | <filename>/var/log/btmp</filename></para>
|
---|
[3ed279f] | 180 | <indexterm zone="ch-system-sysvinit lastb"><primary sortas="b-lastb">lastb</primary></indexterm>
|
---|
[c6cb3aa] | 181 | </listitem>
|
---|
| 182 | </varlistentry>
|
---|
| 183 |
|
---|
[b8a819f] | 184 | <varlistentry id="mesg">
|
---|
| 185 | <term><command>mesg</command></term>
|
---|
[c6cb3aa] | 186 | <listitem>
|
---|
[2256873] | 187 | <para>Controls whether other users can send messages to the current
|
---|
| 188 | user's terminal</para>
|
---|
[3ed279f] | 189 | <indexterm zone="ch-system-sysvinit mesg"><primary sortas="b-mesg">mesg</primary></indexterm>
|
---|
[c6cb3aa] | 190 | </listitem>
|
---|
| 191 | </varlistentry>
|
---|
[73aedd1d] | 192 |
|
---|
[b8a819f] | 193 | <varlistentry id="pidof">
|
---|
| 194 | <term><command>pidof</command></term>
|
---|
[c6cb3aa] | 195 | <listitem>
|
---|
[2256873] | 196 | <para>Reports the PIDs of the given programs</para>
|
---|
[3ed279f] | 197 | <indexterm zone="ch-system-sysvinit pidof"><primary sortas="b-pidof">pidof</primary></indexterm>
|
---|
[c6cb3aa] | 198 | </listitem>
|
---|
| 199 | </varlistentry>
|
---|
[673b0d8] | 200 |
|
---|
[b8a819f] | 201 | <varlistentry id="poweroff">
|
---|
| 202 | <term><command>poweroff</command></term>
|
---|
[c6cb3aa] | 203 | <listitem>
|
---|
[2256873] | 204 | <para>Tells the kernel to halt the system and switch off the computer
|
---|
| 205 | (see <command>halt</command>)</para>
|
---|
[3ed279f] | 206 | <indexterm zone="ch-system-sysvinit poweroff"><primary sortas="b-poweroff">poweroff</primary></indexterm>
|
---|
[c6cb3aa] | 207 | </listitem>
|
---|
| 208 | </varlistentry>
|
---|
[673b0d8] | 209 |
|
---|
[b8a819f] | 210 | <varlistentry id="reboot">
|
---|
| 211 | <term><command>reboot</command></term>
|
---|
[c6cb3aa] | 212 | <listitem>
|
---|
[2256873] | 213 | <para>Tells the kernel to reboot the system (see
|
---|
| 214 | <command>halt</command>)</para>
|
---|
[3ed279f] | 215 | <indexterm zone="ch-system-sysvinit reboot"><primary sortas="b-reboot">reboot</primary></indexterm>
|
---|
[c6cb3aa] | 216 | </listitem>
|
---|
| 217 | </varlistentry>
|
---|
[673b0d8] | 218 |
|
---|
[b8a819f] | 219 | <varlistentry id="runlevel">
|
---|
| 220 | <term><command>runlevel</command></term>
|
---|
[c6cb3aa] | 221 | <listitem>
|
---|
[2256873] | 222 | <para>Reports the previous and the current run-level, as noted in the last run-level
|
---|
| 223 | record in <filename>/var/run/utmp</filename></para>
|
---|
[3ed279f] | 224 | <indexterm zone="ch-system-sysvinit runlevel"><primary sortas="b-runlevel">runlevel</primary></indexterm>
|
---|
[c6cb3aa] | 225 | </listitem>
|
---|
| 226 | </varlistentry>
|
---|
| 227 |
|
---|
[b8a819f] | 228 | <varlistentry id="shutdown">
|
---|
| 229 | <term><command>shutdown</command></term>
|
---|
[c6cb3aa] | 230 | <listitem>
|
---|
[2256873] | 231 | <para>Brings the system down in a secure way, signaling all processes
|
---|
| 232 | and notifying all logged-in users</para>
|
---|
[3ed279f] | 233 | <indexterm zone="ch-system-sysvinit shutdown"><primary sortas="b-shutdown">shutdown</primary></indexterm>
|
---|
[c6cb3aa] | 234 | </listitem>
|
---|
| 235 | </varlistentry>
|
---|
[673b0d8] | 236 |
|
---|
[b8a819f] | 237 | <varlistentry id="sulogin">
|
---|
| 238 | <term><command>sulogin</command></term>
|
---|
[c6cb3aa] | 239 | <listitem>
|
---|
[2256873] | 240 | <para>Allows <emphasis>root</emphasis> to log in; it is
|
---|
| 241 | normally invoked by <command>init</command> when the system goes into single user mode</para>
|
---|
[3ed279f] | 242 | <indexterm zone="ch-system-sysvinit sulogin"><primary sortas="b-sulogin">sulogin</primary></indexterm>
|
---|
[0e9a9e2] | 243 | <beginpage/></listitem>
|
---|
[c6cb3aa] | 244 | </varlistentry>
|
---|
[673b0d8] | 245 |
|
---|
[b8a819f] | 246 | <varlistentry id="telinit">
|
---|
| 247 | <term><command>telinit</command></term>
|
---|
[c6cb3aa] | 248 | <listitem>
|
---|
[2256873] | 249 | <para>Tells <command>init</command> which run-level to change to</para>
|
---|
[3ed279f] | 250 | <indexterm zone="ch-system-sysvinit telinit"><primary sortas="b-telinit">telinit</primary></indexterm>
|
---|
[c6cb3aa] | 251 | </listitem>
|
---|
| 252 | </varlistentry>
|
---|
[673b0d8] | 253 |
|
---|
[b8a819f] | 254 | <varlistentry id="utmpdump">
|
---|
| 255 | <term><command>utmpdump</command></term>
|
---|
[c6cb3aa] | 256 | <listitem>
|
---|
[2256873] | 257 | <para>Displays the content of the given login file in a more
|
---|
| 258 | user-friendly format</para>
|
---|
[3ed279f] | 259 | <indexterm zone="ch-system-sysvinit utmpdump"><primary sortas="b-utmpdump">utmpdump</primary></indexterm>
|
---|
[c6cb3aa] | 260 | </listitem>
|
---|
| 261 | </varlistentry>
|
---|
[673b0d8] | 262 |
|
---|
[b8a819f] | 263 | <varlistentry id="wall">
|
---|
| 264 | <term><command>wall</command></term>
|
---|
[c6cb3aa] | 265 | <listitem>
|
---|
[2256873] | 266 | <para>Writes a message to all logged-in users</para>
|
---|
[3ed279f] | 267 | <indexterm zone="ch-system-sysvinit wall"><primary sortas="b-wall">wall</primary></indexterm>
|
---|
[c6cb3aa] | 268 | </listitem>
|
---|
| 269 | </varlistentry>
|
---|
| 270 | </variablelist>
|
---|
[673b0d8] | 271 |
|
---|
| 272 | </sect2>
|
---|
| 273 |
|
---|
| 274 | </sect1>
|
---|
[ef13657] | 275 |
|
---|