sysvinit.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-sysvinit" role="wrap">
  8. <?dbhtml filename="sysvinit.html"?>
  9. <title>Sysvinit-&sysvinit-version;</title>
  10. <indexterm zone="ch-system-sysvinit">
  11. <primary sortas="a-Sysvinit">Sysvinit</primary>
  12. </indexterm>
  13. <sect2 role="package">
  14. <title/>
  15. <para>The Sysvinit package contains programs for controlling the startup,
  16. running, and shutdown of the system.</para>
  17. <segmentedlist>
  18. <segtitle>&buildtime;</segtitle>
  19. <segtitle>&diskspace;</segtitle>
  20. <seglistitem>
  21. <seg>0.1 SBU</seg><seg>1012 KB</seg>
  22. </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>This package does not come with a test suite.</para>
  42. <para>Install the package:</para>
  43. <screen><userinput>make -C src install</userinput></screen>
  44. </sect2>
  45. <sect2 id="conf-sysvinit" role="configuration">
  46. <title>Configuring Sysvinit</title>
  47. <indexterm zone="conf-sysvinit">
  48. <primary sortas="a-Sysvinit">Sysvinit</primary>
  49. <secondary>configuring</secondary>
  50. </indexterm>
  51. <indexterm zone="conf-sysvinit">
  52. <primary sortas="e-/etc/inittab">/etc/inittab</primary>
  53. </indexterm>
  54. <para>Create a new file <filename>/etc/inittab</filename> by running the
  55. following:</para>
  56. <screen><userinput>cat &gt; /etc/inittab &lt;&lt; "EOF"
  57. <literal># Begin /etc/inittab
  58. id:3:initdefault:
  59. si::sysinit:/etc/rc.d/init.d/rc sysinit
  60. l0:0:wait:/etc/rc.d/init.d/rc 0
  61. l1:S1:wait:/etc/rc.d/init.d/rc 1
  62. l2:2:wait:/etc/rc.d/init.d/rc 2
  63. l3:3:wait:/etc/rc.d/init.d/rc 3
  64. l4:4:wait:/etc/rc.d/init.d/rc 4
  65. l5:5:wait:/etc/rc.d/init.d/rc 5
  66. l6:6:wait:/etc/rc.d/init.d/rc 6
  67. ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
  68. su:S016:once:/sbin/sulogin
  69. 1:2345:respawn:/sbin/agetty tty1 9600
  70. 2:2345:respawn:/sbin/agetty tty2 9600
  71. 3:2345:respawn:/sbin/agetty tty3 9600
  72. 4:2345:respawn:/sbin/agetty tty4 9600
  73. 5:2345:respawn:/sbin/agetty tty5 9600
  74. 6:2345:respawn:/sbin/agetty tty6 9600
  75. # End /etc/inittab</literal>
  76. EOF</userinput></screen>
  77. </sect2>
  78. <sect2 id="contents-sysvinit" role="content">
  79. <title>Contents of Sysvinit</title>
  80. <segmentedlist>
  81. <segtitle>Installed programs</segtitle>
  82. <seglistitem>
  83. <seg>halt, init, killall5, last, lastb (link to last), mesg, mountpoint,
  84. pidof (link to killall5), poweroff (link to halt), reboot (link to halt),
  85. runlevel, shutdown, sulogin, telinit (link to init), utmpdump, and
  86. wall</seg>
  87. </seglistitem>
  88. </segmentedlist>
  89. <variablelist>
  90. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  91. <?dbfo list-presentation="list"?>
  92. <?dbhtml list-presentation="table"?>
  93. <varlistentry id="halt">
  94. <term><command>halt</command></term>
  95. <listitem>
  96. <para>Normally invokes <command>shutdown</command> with the
  97. <parameter>-h</parameter> option, except when already in run-level 0,
  98. then it tells the kernel to halt the system; it notes in the
  99. file <filename>/var/log/wtmp</filename> that the system is being
  100. brought down</para>
  101. <indexterm zone="ch-system-sysvinit halt">
  102. <primary sortas="b-halt">halt</primary>
  103. </indexterm>
  104. </listitem>
  105. </varlistentry>
  106. <varlistentry id="init">
  107. <term><command>init</command></term>
  108. <listitem>
  109. <para>The first process to be started when the kernel has initialized
  110. the hardware which takes over the boot process and starts all the
  111. proceses it is instructed to</para>
  112. <indexterm zone="ch-system-sysvinit init">
  113. <primary sortas="b-init">init</primary>
  114. </indexterm>
  115. </listitem>
  116. </varlistentry>
  117. <varlistentry id="killall5">
  118. <term><command>killall5</command></term>
  119. <listitem>
  120. <para>Sends a signal to all processes, except the processes in its own
  121. session so it will not kill the shell running the script that called
  122. it</para>
  123. <indexterm zone="ch-system-sysvinit killall5">
  124. <primary sortas="b-killall5">killall5</primary>
  125. </indexterm>
  126. </listitem>
  127. </varlistentry>
  128. <varlistentry id="last">
  129. <term><command>last</command></term>
  130. <listitem>
  131. <para>Shows which users last logged in (and out), searching back
  132. through the <filename>/var/log/wtmp</filename> file; it also shows
  133. system boots, shutdowns, and run-level changes</para>
  134. <indexterm zone="ch-system-sysvinit last">
  135. <primary sortas="b-last">last</primary>
  136. </indexterm>
  137. </listitem>
  138. </varlistentry>
  139. <varlistentry id="lastb">
  140. <term><command>lastb</command></term>
  141. <listitem>
  142. <para>Shows the failed login attempts, as logged in
  143. <filename>/var/log/btmp</filename></para>
  144. <indexterm zone="ch-system-sysvinit lastb">
  145. <primary sortas="b-lastb">lastb</primary>
  146. </indexterm>
  147. </listitem>
  148. </varlistentry>
  149. <varlistentry id="mesg">
  150. <term><command>mesg</command></term>
  151. <listitem>
  152. <para>Controls whether other users can send messages to the current
  153. user's terminal</para>
  154. <indexterm zone="ch-system-sysvinit mesg">
  155. <primary sortas="b-mesg">mesg</primary>
  156. </indexterm>
  157. </listitem>
  158. </varlistentry>
  159. <varlistentry id="mountpoint">
  160. <term><command>mountpoint</command></term>
  161. <listitem>
  162. <para>Checks if the directory is a mountpoint</para>
  163. <indexterm zone="ch-system-sysvinit mountpoint">
  164. <primary sortas="b-mountpoint">mountpoint</primary>
  165. </indexterm>
  166. </listitem>
  167. </varlistentry>
  168. <varlistentry id="pidof">
  169. <term><command>pidof</command></term>
  170. <listitem>
  171. <para>Reports the PIDs of the given programs</para>
  172. <indexterm zone="ch-system-sysvinit pidof">
  173. <primary sortas="b-pidof">pidof</primary>
  174. </indexterm>
  175. </listitem>
  176. </varlistentry>
  177. <varlistentry id="poweroff">
  178. <term><command>poweroff</command></term>
  179. <listitem>
  180. <para>Tells the kernel to halt the system and switch off the computer
  181. (see <command>halt</command>)</para>
  182. <indexterm zone="ch-system-sysvinit poweroff">
  183. <primary sortas="b-poweroff">poweroff</primary>
  184. </indexterm>
  185. </listitem>
  186. </varlistentry>
  187. <varlistentry id="reboot">
  188. <term><command>reboot</command></term>
  189. <listitem>
  190. <para>Tells the kernel to reboot the system (see
  191. <command>halt</command>)</para>
  192. <indexterm zone="ch-system-sysvinit reboot">
  193. <primary sortas="b-reboot">reboot</primary>
  194. </indexterm>
  195. </listitem>
  196. </varlistentry>
  197. <varlistentry id="runlevel">
  198. <term><command>runlevel</command></term>
  199. <listitem>
  200. <para>Reports the previous and the current run-level, as noted in the
  201. last run-level record in <filename>/var/run/utmp</filename></para>
  202. <indexterm zone="ch-system-sysvinit runlevel">
  203. <primary sortas="b-runlevel">runlevel</primary>
  204. </indexterm>
  205. </listitem>
  206. </varlistentry>
  207. <varlistentry id="shutdown">
  208. <term><command>shutdown</command></term>
  209. <listitem>
  210. <para>Brings the system down in a secure way, signaling all processes
  211. and notifying all logged-in users</para>
  212. <indexterm zone="ch-system-sysvinit shutdown">
  213. <primary sortas="b-shutdown">shutdown</primary>
  214. </indexterm>
  215. </listitem>
  216. </varlistentry>
  217. <varlistentry id="sulogin">
  218. <term><command>sulogin</command></term>
  219. <listitem>
  220. <para>Allows <systemitem class="username">root</systemitem> to log in;
  221. it is normally invoked by <command>init</command> when the system goes
  222. into single user mode</para>
  223. <indexterm zone="ch-system-sysvinit sulogin">
  224. <primary sortas="b-sulogin">sulogin</primary>
  225. </indexterm>
  226. </listitem>
  227. </varlistentry>
  228. <varlistentry id="telinit">
  229. <term><command>telinit</command></term>
  230. <listitem>
  231. <para>Tells <command>init</command> which run-level to change to</para>
  232. <indexterm zone="ch-system-sysvinit telinit">
  233. <primary sortas="b-telinit">telinit</primary>
  234. </indexterm>
  235. </listitem>
  236. </varlistentry>
  237. <varlistentry id="utmpdump">
  238. <term><command>utmpdump</command></term>
  239. <listitem>
  240. <para>Displays the content of the given login file in a more
  241. user-friendly format</para>
  242. <indexterm zone="ch-system-sysvinit utmpdump">
  243. <primary sortas="b-utmpdump">utmpdump</primary>
  244. </indexterm>
  245. </listitem>
  246. </varlistentry>
  247. <varlistentry id="wall">
  248. <term><command>wall</command></term>
  249. <listitem>
  250. <para>Writes a message to all logged-in users</para>
  251. <indexterm zone="ch-system-sysvinit wall">
  252. <primary sortas="b-wall">wall</primary>
  253. </indexterm>
  254. </listitem>
  255. </varlistentry>
  256. </variablelist>
  257. </sect2>
  258. </sect1>