sysvinit.xml 8.7 KB

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