sysvinit.xml 10 KB

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