usage.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  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. <!ENTITY site SYSTEM "../appendices/rc.site.script">
  6. %general-entities;
  7. ]>
  8. <sect1 id="ch-scripts-usage">
  9. <?dbhtml filename="usage.html"?>
  10. <title>System V Bootscript Usage and Configuration</title>
  11. <indexterm zone="ch-scripts-usage">
  12. <primary sortas="a-Bootscripts">Bootscripts</primary>
  13. <secondary>usage</secondary>
  14. </indexterm>
  15. <sect2>
  16. <title>How Do the System V Bootscripts Work?</title>
  17. <para>Linux uses a special booting facility named SysVinit that is based on a
  18. concept of <emphasis>run-levels</emphasis>. It can be quite different from one
  19. system to another, so it cannot be assumed that because things worked in one
  20. particular Linux distribution, they should work the same in LFS too. LFS has its
  21. own way of doing things, but it respects generally accepted standards.</para>
  22. <para>SysVinit (which will be referred to as <quote>init</quote> from now on)
  23. works using a run-levels scheme. There are seven (numbered 0 to 6) run-levels
  24. (actually, there are more run-levels, but they are for special cases and are
  25. generally not used. See <filename>init(8)</filename> for more details), and
  26. each one of those corresponds to the actions the computer is supposed to
  27. perform when it starts up. The default run-level is 3. Here are the
  28. descriptions of the different run-levels as they are implemented:</para>
  29. <literallayout>0: halt the computer
  30. 1: single-user mode
  31. 2: multi-user mode without networking
  32. 3: multi-user mode with networking
  33. 4: reserved for customization, otherwise does the same as 3
  34. 5: same as 4, it is usually used for GUI login (like X's <command>xdm</command> or KDE's <command>kdm</command>)
  35. 6: reboot the computer</literallayout>
  36. </sect2>
  37. <sect2 id="conf-sysvinit" role="configuration">
  38. <title>Configuring Sysvinit</title>
  39. <indexterm zone="conf-sysvinit">
  40. <primary sortas="a-Sysvinit">Sysvinit</primary>
  41. <secondary>configuring</secondary>
  42. </indexterm>
  43. <indexterm zone="conf-sysvinit">
  44. <primary sortas="e-/etc/inittab">/etc/inittab</primary>
  45. </indexterm>
  46. <para>During the kernel initialization, the first program that is run
  47. is either specified on the command line or, by default
  48. <command>init</command>. This program reads the initialization file
  49. <filename>/etc/inittab</filename>. Create this file with:</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 S
  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 --noclear 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. <para>An explanation of this initialization file is in the man page for
  72. <emphasis>inittab</emphasis>. For LFS, the key command that is run is
  73. <command>rc</command>. The intialization file above will instruct
  74. <command>rc</command> to run all the scripts starting with an S in the
  75. <filename class="directory">/etc/rc.d/rcS.d</filename> directory
  76. followed by all the scripts starting with an S in the <filename
  77. class="directory">/etc/rc.d/rc?.d</filename> directory where the question
  78. mark is specified by the initdefault value.</para>
  79. <para>As a convenience, the <command>rc</command> script reads a library of
  80. functions in <filename class="directory">/lib/lsb/init-functions</filename>.
  81. This library also reads an optional configuration file,
  82. <filename>/etc/sysconfig/rc.site</filename>. Any of the system
  83. configuration file parameters described in subsequent sections can be
  84. alternatively placed in this file allowing consolidation of all system
  85. parameters in this one file.</para>
  86. <para>As a debugging convenience, the functions script also logs all output
  87. to <filename>/run/var/bootlog</filename>. Since the <filename
  88. class="directory">/run</filename> directory is a tmpfs, this file is not
  89. persistent across boots, however it is appended to the more permanent file
  90. <filename>/var/log/boot.log</filename> at the end of the boot process.</para>
  91. <sect3 id="init-levels" >
  92. <title>Changing Run Levels</title>
  93. <para>Changing run-levels is done with <command>init
  94. <replaceable>&lt;runlevel&gt;</replaceable></command>, where
  95. <replaceable>&lt;runlevel&gt;</replaceable> is the target run-level. For example, to
  96. reboot the computer, a user could issue the <command>init 6</command> command,
  97. which is an alias for the <command>reboot</command> command. Likewise,
  98. <command>init 0</command> is an alias for the <command>halt</command>
  99. command.</para>
  100. <para>There are a number of directories under <filename
  101. class="directory">/etc/rc.d</filename> that look like <filename
  102. class="directory">rc?.d</filename> (where ? is the number of the run-level) and
  103. <filename class="directory">rcsysinit.d</filename>, all containing a number of
  104. symbolic links. Some begin with a <emphasis>K</emphasis>, the others begin with
  105. an <emphasis>S</emphasis>, and all of them have two numbers following the
  106. initial letter. The K means to stop (kill) a service and the S means to start a
  107. service. The numbers determine the order in which the scripts are run, from 00
  108. to 99&mdash;the lower the number the earlier it gets executed. When
  109. <command>init</command> switches to another run-level, the appropriate services
  110. are either started or stopped, depending on the runlevel chosen.</para>
  111. <para>The real scripts are in <filename
  112. class="directory">/etc/rc.d/init.d</filename>. They do the actual work, and
  113. the symlinks all point to them. K links and S links point to
  114. the same script in <filename class="directory">/etc/rc.d/init.d</filename>.
  115. This is because the scripts can be called with different parameters like
  116. <parameter>start</parameter>, <parameter>stop</parameter>,
  117. <parameter>restart</parameter>, <parameter>reload</parameter>, and
  118. <parameter>status</parameter>. When a K link is encountered, the appropriate
  119. script is run with the <parameter>stop</parameter> argument. When an S link
  120. is encountered, the appropriate script is run with the
  121. <parameter>start</parameter> argument.</para>
  122. <para>There is one exception to this explanation. Links that start
  123. with an <emphasis>S</emphasis> in the <filename
  124. class="directory">rc0.d</filename> and <filename
  125. class="directory">rc6.d</filename> directories will not cause anything
  126. to be started. They will be called with the parameter
  127. <parameter>stop</parameter> to stop something. The logic behind this
  128. is that when a user is going to reboot or halt the system, nothing
  129. needs to be started. The system only needs to be stopped.</para>
  130. <para>These are descriptions of what the arguments make the scripts
  131. do:</para>
  132. <variablelist>
  133. <varlistentry>
  134. <term><parameter>start</parameter></term>
  135. <listitem>
  136. <para>The service is started.</para>
  137. </listitem>
  138. </varlistentry>
  139. <varlistentry>
  140. <term><parameter>stop</parameter></term>
  141. <listitem>
  142. <para>The service is stopped.</para>
  143. </listitem>
  144. </varlistentry>
  145. <varlistentry>
  146. <term><parameter>restart</parameter></term>
  147. <listitem>
  148. <para>The service is stopped and then started again.</para>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry>
  152. <term><parameter>reload</parameter></term>
  153. <listitem>
  154. <para>The configuration of the service is updated.
  155. This is used after the configuration file of a service was modified, when
  156. the service does not need to be restarted.</para>
  157. </listitem>
  158. </varlistentry>
  159. <varlistentry>
  160. <term><parameter>status</parameter></term>
  161. <listitem>
  162. <para>Tells if the service is running and with which PIDs.</para>
  163. </listitem>
  164. </varlistentry>
  165. </variablelist>
  166. <para>Feel free to modify the way the boot process works (after all,
  167. it is your own LFS system). The files given here are an example of how
  168. it can be done.</para>
  169. </sect3>
  170. </sect2>
  171. <sect2 id="ch-scripts-clock">
  172. <title>Configuring the System Clock</title>
  173. <sect3 id="ch-scripts-setclock">
  174. <title>System V Clock Configuration</title>
  175. <indexterm zone="ch-scripts-setclock">
  176. <primary sortas="d-setclock">setclock</primary>
  177. <secondary>configuring</secondary></indexterm>
  178. <para>The <command>setclock</command> script reads the time from the hardware
  179. clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
  180. (CMOS) clock. If the hardware clock is set to UTC, this script will convert the
  181. hardware clock's time to the local time using the
  182. <filename>/etc/localtime</filename> file (which tells the
  183. <command>hwclock</command> program which timezone the user is in). There is no
  184. way to detect whether or not the hardware clock is set to UTC, so this
  185. needs to be configured manually.</para>
  186. <para>The <command>setclock</command> is run via
  187. <application>udev</application> when the kernel detects the hardware
  188. capability upon boot. It can also be run manually with the stop parameter to
  189. store the system time to the CMOS clock.</para>
  190. <para>If you cannot remember whether or not the hardware clock is set to UTC,
  191. find out by running the <userinput>hwclock --localtime --show</userinput>
  192. command. This will display what the current time is according to the hardware
  193. clock. If this time matches whatever your watch says, then the hardware clock is
  194. set to local time. If the output from <command>hwclock</command> is not local
  195. time, chances are it is set to UTC time. Verify this by adding or subtracting
  196. the proper amount of hours for the timezone to the time shown by
  197. <command>hwclock</command>. For example, if you are currently in the MST
  198. timezone, which is also known as GMT -0700, add seven hours to the local
  199. time.</para>
  200. <para>Change the value of the <envar>UTC</envar> variable below
  201. to a value of <parameter>0</parameter> (zero) if the hardware clock
  202. is <emphasis>not</emphasis> set to UTC time.</para>
  203. <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
  204. the following:</para>
  205. <screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"
  206. <literal># Begin /etc/sysconfig/clock
  207. UTC=1
  208. # Set this to any options you might need to give to hwclock,
  209. # such as machine hardware clock type for Alphas.
  210. CLOCKPARAMS=
  211. # End /etc/sysconfig/clock</literal>
  212. EOF</userinput></screen>
  213. <para>A good hint explaining how to deal with time on LFS is available
  214. at <ulink url="&hints-root;time.txt"/>. It explains issues such as
  215. time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
  216. <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set
  217. in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note>
  218. </sect3>
  219. </sect2>
  220. <sect2 id="ch-scripts-console">
  221. <?dbhtml filename="console.html"?>
  222. <title>Configuring the Linux Console</title>
  223. <indexterm zone="ch-scripts-console">
  224. <primary sortas="d-console">console</primary>
  225. <secondary>configuring</secondary>
  226. </indexterm>
  227. <para>This section discusses how to configure the <command>console</command>
  228. bootscript that sets up the keyboard map, console font and console kernel log
  229. level. If non-ASCII characters (e.g., the copyright sign, the British pound
  230. sign and Euro symbol) will not be used and the keyboard is a U.S. one, much
  231. of this section can be skipped. Without the configuration file, (or
  232. equivalent settings in <filename>rc.site</filename>), the
  233. <command>console</command> bootscript will do nothing.</para>
  234. <para>The <command>console</command> script reads the
  235. <filename>/etc/sysconfig/console</filename> file for configuration
  236. information. Decide which keymap and screen font will be used. Various
  237. language-specific HOWTOs can also help with this, see <ulink
  238. url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in
  239. doubt, look in the <filename class="directory">/usr/share/keymaps</filename>
  240. and <filename class="directory">/usr/share/consolefonts</filename> directories
  241. for valid keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
  242. <filename>setfont(8)</filename> manual pages to determine the correct
  243. arguments for these programs.</para>
  244. <para>The <filename>/etc/sysconfig/console</filename> file should contain lines
  245. of the form: VARIABLE="value". The following variables are recognized:</para>
  246. <variablelist>
  247. <varlistentry>
  248. <term>LOGLEVEL</term>
  249. <listitem>
  250. <para>This variable specifies the log level for kernel messages sent
  251. to the console as set by <command>dmesg</command>. Valid levels are
  252. from "1" (no messages) to "8". The default level is "7".</para>
  253. </listitem>
  254. </varlistentry>
  255. <varlistentry>
  256. <term>KEYMAP</term>
  257. <listitem>
  258. <para>This variable specifies the arguments for the
  259. <command>loadkeys</command> program, typically, the name of keymap
  260. to load, e.g., <quote>es</quote>. If this variable is not set, the
  261. bootscript will not run the <command>loadkeys</command> program,
  262. and the default kernel keymap will be used.</para>
  263. </listitem>
  264. </varlistentry>
  265. <varlistentry>
  266. <term>KEYMAP_CORRECTIONS</term>
  267. <listitem>
  268. <para>This (rarely used) variable
  269. specifies the arguments for the second call to the
  270. <command>loadkeys</command> program. This is useful if the stock keymap
  271. is not completely satisfactory and a small adjustment has to be made. E.g.,
  272. to include the Euro sign into a keymap that normally doesn't have it,
  273. set this variable to <quote>euro2</quote>.</para>
  274. </listitem>
  275. </varlistentry>
  276. <varlistentry>
  277. <term>FONT</term>
  278. <listitem>
  279. <para>This variable specifies the arguments for the
  280. <command>setfont</command> program. Typically, this includes the font
  281. name, <quote>-m</quote>, and the name of the application character
  282. map to load. E.g., in order to load the <quote>lat1-16</quote> font
  283. together with the <quote>8859-1</quote> application character map
  284. (as it is appropriate in the USA),
  285. <!-- because of the copyright sign -->
  286. set this variable to <quote>lat1-16 -m 8859-1</quote>.
  287. In UTF-8 mode, the kernel uses the application character map for
  288. conversion of composed 8-bit key codes in the keymap to UTF-8, and thus
  289. the argument of the "-m" parameter should be set to the encoding of the
  290. composed key codes in the keymap.</para>
  291. </listitem>
  292. </varlistentry>
  293. <varlistentry>
  294. <term>UNICODE</term>
  295. <listitem>
  296. <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or
  297. <quote>true</quote> in order to put the
  298. console into UTF-8 mode. This is useful in UTF-8 based locales and
  299. harmful otherwise.</para>
  300. </listitem>
  301. </varlistentry>
  302. <varlistentry>
  303. <term>LEGACY_CHARSET</term>
  304. <listitem>
  305. <para>For many keyboard layouts, there is no stock Unicode keymap in
  306. the Kbd package. The <command>console</command> bootscript will
  307. convert an available keymap to UTF-8 on the fly if this variable is
  308. set to the encoding of the available non-UTF-8 keymap.</para>
  309. </listitem>
  310. </varlistentry>
  311. </variablelist>
  312. <para>Some examples:</para>
  313. <itemizedlist>
  314. <listitem>
  315. <para>For a non-Unicode setup, only the KEYMAP and FONT variables are
  316. generally needed. E.g., for a Polish setup, one would use:</para>
  317. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  318. <literal># Begin /etc/sysconfig/console
  319. KEYMAP="pl2"
  320. FONT="lat2a-16 -m 8859-2"
  321. # End /etc/sysconfig/console</literal>
  322. EOF</userinput></screen>
  323. </listitem>
  324. <listitem>
  325. <para>As mentioned above, it is sometimes necessary to adjust a
  326. stock keymap slightly. The following example adds the Euro symbol to the
  327. German keymap:</para>
  328. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  329. <literal># Begin /etc/sysconfig/console
  330. KEYMAP="de-latin1"
  331. KEYMAP_CORRECTIONS="euro2"
  332. FONT="lat0-16 -m 8859-15"
  333. # End /etc/sysconfig/console</literal>
  334. EOF</userinput></screen>
  335. </listitem>
  336. <listitem>
  337. <para>The following is a Unicode-enabled example for Bulgarian, where a
  338. stock UTF-8 keymap exists:</para>
  339. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  340. <literal># Begin /etc/sysconfig/console
  341. UNICODE="1"
  342. KEYMAP="bg_bds-utf8"
  343. FONT="LatArCyrHeb-16"
  344. # End /etc/sysconfig/console</literal>
  345. EOF</userinput></screen>
  346. </listitem>
  347. <listitem>
  348. <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous
  349. example, bright colors are no longer available on the Linux console unless
  350. a framebuffer is used. If one wants to have bright colors without
  351. framebuffer and can live without characters not belonging to his language,
  352. it is still possible to use a language-specific 256-glyph font, as
  353. illustrated below:</para>
  354. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  355. <literal># Begin /etc/sysconfig/console
  356. UNICODE="1"
  357. KEYMAP="bg_bds-utf8"
  358. FONT="cyr-sun16"
  359. # End /etc/sysconfig/console</literal>
  360. EOF</userinput></screen>
  361. </listitem>
  362. <listitem>
  363. <para>The following example illustrates keymap autoconversion from
  364. ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:</para>
  365. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  366. <literal># Begin /etc/sysconfig/console
  367. UNICODE="1"
  368. KEYMAP="de-latin1"
  369. KEYMAP_CORRECTIONS="euro2"
  370. LEGACY_CHARSET="iso-8859-15"
  371. FONT="LatArCyrHeb-16 -m 8859-15"
  372. # End /etc/sysconfig/console</literal>
  373. EOF</userinput></screen>
  374. </listitem>
  375. <listitem>
  376. <para>Some keymaps have dead keys (i.e., keys that don't produce a
  377. character by themselves, but put an accent on the character produced
  378. by the next key) or define composition rules (such as: <quote>press
  379. Ctrl+. A E to get &AElig;</quote> in the default keymap).
  380. Linux-&linux-version; interprets dead keys and composition rules in the
  381. keymap correctly only when the source characters to be composed together
  382. are not multibyte. This deficiency doesn't affect keymaps for European
  383. languages, because there accents are added to unaccented ASCII
  384. characters, or two ASCII characters are composed together. However, in
  385. UTF-8 mode it is a problem, e.g., for the Greek language, where one
  386. sometimes needs to put an accent on the letter <quote>alpha</quote>.
  387. The solution is either to avoid the use of UTF-8, or to install the
  388. X window system that doesn't have this limitation in its input
  389. handling.</para>
  390. </listitem>
  391. <listitem>
  392. <para>For Chinese, Japanese, Korean and some other languages, the Linux
  393. console cannot be configured to display the needed characters. Users
  394. who need such languages should install the X Window System, fonts that
  395. cover the necessary character ranges, and the proper input method (e.g.,
  396. SCIM, it supports a wide variety of languages).</para>
  397. </listitem>
  398. </itemizedlist>
  399. <!-- Added because folks keep posting their console file with X questions
  400. to blfs-support list -->
  401. <note>
  402. <para>The <filename>/etc/sysconfig/console</filename> file only controls
  403. the Linux text console localization. It has nothing to do with setting
  404. the proper keyboard layout and terminal fonts in the X Window System, with
  405. ssh sessions or with a serial console. In such situations, limitations
  406. mentioned in the last two list items above do not apply.</para>
  407. </note>
  408. </sect2>
  409. <sect2 id="ch-scripts-createfiles">
  410. <title>Creating Files at Boot</title>
  411. <indexterm zone="ch-scripts-createfiles">
  412. <primary sortas="d-createfiles">File creation at boot</primary>
  413. <secondary>configuring</secondary>
  414. </indexterm>
  415. <para>At times, it is desired to create files at boot time. For instance,
  416. the <filename class="directory">/tmp/.ICE-unix</filename> directory
  417. may be desired. This can be done by creating an entry in the
  418. <filename>/etc/sysconfig/createfiles</filename> configuration script.
  419. The format of this file is embedded in the comments of the default
  420. configuration file.</para>
  421. </sect2>
  422. <sect2 id="ch-scripts-sysklogd">
  423. <title>Configuring the sysklogd Script</title>
  424. <indexterm zone="ch-scripts-sysklogd">
  425. <primary sortas="d-sysklogd">sysklogd</primary>
  426. <secondary>configuring</secondary>
  427. </indexterm>
  428. <para>The <filename>sysklogd</filename> script invokes the
  429. <command>syslogd</command> program as a part of System V initialization. The
  430. <parameter>-m 0</parameter> option turns off the periodic timestamp mark that
  431. <command>syslogd</command> writes to the log files every 20 minutes by
  432. default. If you want to turn on this periodic timestamp mark, edit
  433. <filename>/etc/sysconfig/rc.site</filename> and define the variable
  434. SYSKLOGD_PARMS to the desired value. For instance, to remove all parameters,
  435. set the variable to a null value:</para>
  436. <screen role="nodump">SYSKLOGD_PARMS=</screen>
  437. <para>See <userinput>man syslogd</userinput> for more options.</para>
  438. </sect2>
  439. <sect2 id="ch-scripts-site">
  440. <title>The rc.site File</title>
  441. <indexterm zone="ch-scripts-site">
  442. <primary sortas="a-rc.site">rc.site</primary>
  443. </indexterm>
  444. <para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains
  445. settings that are automatically set for each SystemV boot script. It can
  446. alternatively set the values specified in the <filename>hostname</filename>,
  447. <filename>console</filename>, and <filename>clock</filename> files in the
  448. <filename class='directory'>/etc/sysconfig/</filename> directory. If the
  449. associated variables are present in both these separate files and
  450. <filename>rc.site</filename>, the values in the script specific files have
  451. precedence. </para>
  452. <para><filename>rc.site</filename> also contains parameters that can
  453. customize other aspects of the boot process. Setting the IPROMPT variable
  454. will enable selective running of bootscripts. Other options are described
  455. in the file comments. The default version of the file is as follows:</para>
  456. <!-- Use role to fix a pdf generation problem -->
  457. <screen role="auto">&site;</screen>
  458. <sect3>
  459. <title>Customizing the Boot and Shutdown Scripts</title>
  460. <para>The LFS boot scripts boot and shut down a system in a fairly
  461. efficient manner, but there are a few tweaks that you can make in the
  462. rc.site file to improve speed even more and to adjust messages according
  463. to your preferences. To do this, adjust the settings in
  464. the <filename>/etc/sysconfig/rc.site</filename> file above.</para>
  465. <itemizedlist>
  466. <listitem><para>During the boot script <filename>udev</filename>, there is
  467. a call to <command>udev settle</command> that requires some time to
  468. complete. This time may or may not be required depending on devices present
  469. in the system. If you only have simple partitions and a single ethernet
  470. card, the boot process will probably not need to wait for this command. To
  471. skip it, set the variable OMIT_UDEV_SETTLE=y.</para></listitem>
  472. <listitem><para>The boot script <filename>udev_retry</filename> also runs
  473. <command>udev settle</command> by default. This command is only needed by
  474. default if the <filename class='directory'>/var</filename> directory is
  475. separately mounted. This is because the clock needs the file
  476. <filename>/var/lib/hwclock/adjtime</filename>. Other customizations may
  477. also need to wait for udev to complete, but in many installations it is not
  478. needed. Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y.
  479. </para></listitem>
  480. <listitem><para>By default, the file system checks are silent. This can
  481. appear to be a delay during the bootup process. To turn on the
  482. <command>fsck</command> output, set the variable VERBOSE_FSCK=y.
  483. </para></listitem>
  484. <listitem><para>When rebooting, you may want to skip the filesystem check,
  485. <command>fsck</command>, completely. To do this, either create the file
  486. <filename>/fastboot</filename> or reboot the system with the command
  487. <command>/sbin/shutdown -f -r now</command>. On the other hand, you can
  488. force all file systems to be checked by creating
  489. <filename>/forcefsck</filename> or running <command>shutdown</command> with
  490. the <parameter>-F</parameter> parameter instead of <parameter>-f</parameter>.
  491. </para>
  492. <para>Setting the variable FASTBOOT=y will disable <command>fsck</command>
  493. during the boot process until it is removed. This is not recommended
  494. on a permanent basis.</para></listitem>
  495. <listitem><para>Normally, all files in the <filename
  496. class='directory'>/tmp</filename> directory are deleted at boot time.
  497. Depending on the number of files or directories present, this can cause a
  498. noticeable delay in the boot process. To skip removing these files set the
  499. variable SKIPTMPCLEAN=y.</para></listitem>
  500. <listitem><para>During shutdown, the <command>init</command> program sends
  501. a TERM signal to each program it has started (e.g. agetty), waits for a set
  502. time (default 3 seconds), and sends each process a KILL signal and waits
  503. again. This process is repeated in the <command>sendsignals</command>
  504. script for any processes that are not shut down by their own scripts. The
  505. delay for <command>init</command> can be set by passing a parameter. For
  506. example to remove the delay in <command>init</command>, pass the -t0
  507. parameter when shutting down or rebooting (e.g. <command>/sbin/shutdown
  508. -t0 -r now</command>). The delay for the <command>sendsignals</command>
  509. script can be skipped by setting the parameter
  510. KILLDELAY=0.</para></listitem>
  511. </itemizedlist>
  512. </sect3>
  513. </sect2>
  514. </sect1>