sysvinit.xml 11 KB

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