sysvinit.xml 9.4 KB

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