sysvinit.xml 11 KB

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