usage.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  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" revision="sysv">
  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 initialization 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>
  172. <title>Udev Bootscripts</title>
  173. <para>The <filename>/etc/rc.d/init.d/udev</filename> initscript starts
  174. <command>udevd</command>, triggers any "coldplug" devices that have
  175. already been created by the kernel and waits for any rules to complete.
  176. The script also unsets the uevent handler from the default of
  177. <filename>/sbin/hotplug </filename>. This is done because the kernel no
  178. longer needs to call out to an external binary. Instead
  179. <command>udevd</command> will listen on a netlink socket for uevents that
  180. the kernel raises.</para>
  181. <para>The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes
  182. care of re-triggering events for subsystems whose rules may rely on
  183. filesystems that are not mounted until the <command>mountfs</command>
  184. script is run (in particular, <filename class="directory">/usr</filename>
  185. and <filename class="directory">/var</filename> may cause this). This
  186. script runs after the <command>mountfs</command> script, so those rules
  187. (if re-triggered) should succeed the second time around. It is
  188. configured from the <filename>/etc/sysconfig/udev_retry</filename> file;
  189. any words in this file other than comments are considered subsystem names
  190. to trigger at retry time. To find the subsystem of a device, use
  191. <command>udevadm info --attribute-walk &lt;device&gt;</command> where
  192. &lt;device&gt; is an absolute path in /dev or /sys such as /dev/sr0 or
  193. /sys/class/rtc.</para>
  194. <para>For information on kernel module loading and udev, see
  195. <xref linkend="module-loading"/>.</para>
  196. <!--
  197. <sect3>
  198. <title>Module Loading</title>
  199. <para>Device drivers compiled as modules may have aliases built into them.
  200. Aliases are visible in the output of the <command>modinfo</command>
  201. program and are usually related to the bus-specific identifiers of devices
  202. supported by a module. For example, the <emphasis>snd-fm801</emphasis>
  203. driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801,
  204. and has an alias of <quote>pci:v00001319d00000801sv*sd*bc04sc01i*</quote>.
  205. For most devices, the bus driver exports the alias of the driver that
  206. would handle the device via <systemitem
  207. class="filesystem">sysfs</systemitem>. E.g., the
  208. <filename>/sys/bus/pci/devices/0000:00:0d.0/modalias</filename> file
  209. might contain the string
  210. <quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>.
  211. The default rules provided with Udev will cause <command>udevd</command>
  212. to call out to <command>/sbin/modprobe</command> with the contents of the
  213. <envar>MODALIAS</envar> uevent environment variable (which should be the
  214. same as the contents of the <filename>modalias</filename> file in sysfs),
  215. thus loading all modules whose aliases match this string after wildcard
  216. expansion.</para>
  217. <para>In this example, this means that, in addition to
  218. <emphasis>snd-fm801</emphasis>, the obsolete (and unwanted)
  219. <emphasis>forte</emphasis> driver will be loaded if it is
  220. available. See below for ways in which the loading of unwanted drivers can
  221. be prevented.</para>
  222. <para>The kernel itself is also able to load modules for network
  223. protocols, filesystems and NLS support on demand.</para>
  224. </sect3>
  225. <sect3>
  226. <title>Handling Hotpluggable/Dynamic Devices</title>
  227. <para>When you plug in a device, such as a Universal Serial Bus (USB) MP3
  228. player, the kernel recognizes that the device is now connected and
  229. generates a uevent. This uevent is then handled by
  230. <command>udevd</command> as described above.</para>
  231. </sect3>
  232. -->
  233. </sect2>
  234. <sect2 id="ch-scripts-clock">
  235. <title>Configuring the System Clock</title>
  236. <indexterm zone="ch-scripts-clock">
  237. <primary sortas="d-scripts-setclock">setclock</primary>
  238. <secondary>configuring</secondary></indexterm>
  239. <para>The <command>setclock</command> script reads the time from the hardware
  240. clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
  241. (CMOS) clock. If the hardware clock is set to UTC, this script will convert the
  242. hardware clock's time to the local time using the
  243. <filename>/etc/localtime</filename> file (which tells the
  244. <command>hwclock</command> program which timezone the user is in). There is no
  245. way to detect whether or not the hardware clock is set to UTC, so this
  246. needs to be configured manually.</para>
  247. <para>The <command>setclock</command> is run via
  248. <application>udev</application> when the kernel detects the hardware
  249. capability upon boot. It can also be run manually with the stop parameter to
  250. store the system time to the CMOS clock.</para>
  251. <para>If you cannot remember whether or not the hardware clock is set to UTC,
  252. find out by running the <userinput>hwclock --localtime --show</userinput>
  253. command. This will display what the current time is according to the hardware
  254. clock. If this time matches whatever your watch says, then the hardware clock is
  255. set to local time. If the output from <command>hwclock</command> is not local
  256. time, chances are it is set to UTC time. Verify this by adding or subtracting
  257. the proper amount of hours for the timezone to the time shown by
  258. <command>hwclock</command>. For example, if you are currently in the MST
  259. timezone, which is also known as GMT -0700, add seven hours to the local
  260. time.</para>
  261. <para>Change the value of the <envar>UTC</envar> variable below
  262. to a value of <parameter>0</parameter> (zero) if the hardware clock
  263. is <emphasis>not</emphasis> set to UTC time.</para>
  264. <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
  265. the following:</para>
  266. <screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"
  267. <literal># Begin /etc/sysconfig/clock
  268. UTC=1
  269. # Set this to any options you might need to give to hwclock,
  270. # such as machine hardware clock type for Alphas.
  271. CLOCKPARAMS=
  272. # End /etc/sysconfig/clock</literal>
  273. EOF</userinput></screen>
  274. <para>A good hint explaining how to deal with time on LFS is available
  275. at <ulink url="&hints-root;time.txt"/>. It explains issues such as
  276. time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
  277. <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set
  278. in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note>
  279. </sect2>
  280. <sect2 id="ch-scripts-console">
  281. <?dbhtml filename="console.html"?>
  282. <title>Configuring the Linux Console</title>
  283. <indexterm zone="ch-scripts-console">
  284. <primary sortas="d-console">console</primary>
  285. <secondary>configuring</secondary>
  286. </indexterm>
  287. <para>This section discusses how to configure the <command>console</command>
  288. bootscript that sets up the keyboard map, console font and console kernel log
  289. level. If non-ASCII characters (e.g., the copyright sign, the British pound
  290. sign and Euro symbol) will not be used and the keyboard is a U.S. one, much
  291. of this section can be skipped. Without the configuration file, (or
  292. equivalent settings in <filename>rc.site</filename>), the
  293. <command>console</command> bootscript will do nothing.</para>
  294. <para>The <command>console</command> script reads the
  295. <filename>/etc/sysconfig/console</filename> file for configuration
  296. information. Decide which keymap and screen font will be used. Various
  297. language-specific HOWTOs can also help with this, see <ulink
  298. url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in
  299. doubt, look in the <filename class="directory">/usr/share/keymaps</filename>
  300. and <filename class="directory">/usr/share/consolefonts</filename> directories
  301. for valid keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
  302. <filename>setfont(8)</filename> manual pages to determine the correct
  303. arguments for these programs.</para>
  304. <para>The <filename>/etc/sysconfig/console</filename> file should contain lines
  305. of the form: VARIABLE="value". The following variables are recognized:</para>
  306. <variablelist>
  307. <varlistentry>
  308. <term>LOGLEVEL</term>
  309. <listitem>
  310. <para>This variable specifies the log level for kernel messages sent
  311. to the console as set by <command>dmesg</command>. Valid levels are
  312. from "1" (no messages) to "8". The default level is "7".</para>
  313. </listitem>
  314. </varlistentry>
  315. <varlistentry>
  316. <term>KEYMAP</term>
  317. <listitem>
  318. <para>This variable specifies the arguments for the
  319. <command>loadkeys</command> program, typically, the name of keymap
  320. to load, e.g., <quote>it</quote>. If this variable is not set, the
  321. bootscript will not run the <command>loadkeys</command> program,
  322. and the default kernel keymap will be used. Note that a few keymaps
  323. have multiple versions with the same name (cz and its variants in
  324. qwerty/ and qwertz/, es in olpc/ and qwerty/, and trf in fgGIod/ and
  325. qwerty/). In these cases the parent directory should also be specified
  326. (e.g. qwerty/es) to ensure the proper keymap is loaded.
  327. </para>
  328. </listitem>
  329. </varlistentry>
  330. <varlistentry>
  331. <term>KEYMAP_CORRECTIONS</term>
  332. <listitem>
  333. <para>This (rarely used) variable
  334. specifies the arguments for the second call to the
  335. <command>loadkeys</command> program. This is useful if the stock keymap
  336. is not completely satisfactory and a small adjustment has to be made. E.g.,
  337. to include the Euro sign into a keymap that normally doesn't have it,
  338. set this variable to <quote>euro2</quote>.</para>
  339. </listitem>
  340. </varlistentry>
  341. <varlistentry>
  342. <term>FONT</term>
  343. <listitem>
  344. <para>This variable specifies the arguments for the
  345. <command>setfont</command> program. Typically, this includes the font
  346. name, <quote>-m</quote>, and the name of the application character
  347. map to load. E.g., in order to load the <quote>lat1-16</quote> font
  348. together with the <quote>8859-1</quote> application character map
  349. (as it is appropriate in the USA),
  350. <!-- because of the copyright sign -->
  351. set this variable to <quote>lat1-16 -m 8859-1</quote>.
  352. In UTF-8 mode, the kernel uses the application character map for
  353. conversion of composed 8-bit key codes in the keymap to UTF-8, and thus
  354. the argument of the "-m" parameter should be set to the encoding of the
  355. composed key codes in the keymap.</para>
  356. </listitem>
  357. </varlistentry>
  358. <varlistentry>
  359. <term>UNICODE</term>
  360. <listitem>
  361. <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or
  362. <quote>true</quote> in order to put the
  363. console into UTF-8 mode. This is useful in UTF-8 based locales and
  364. harmful otherwise.</para>
  365. </listitem>
  366. </varlistentry>
  367. <varlistentry>
  368. <term>LEGACY_CHARSET</term>
  369. <listitem>
  370. <para>For many keyboard layouts, there is no stock Unicode keymap in
  371. the Kbd package. The <command>console</command> bootscript will
  372. convert an available keymap to UTF-8 on the fly if this variable is
  373. set to the encoding of the available non-UTF-8 keymap.</para>
  374. </listitem>
  375. </varlistentry>
  376. </variablelist>
  377. <para>Some examples:</para>
  378. <itemizedlist>
  379. <listitem>
  380. <para>For a non-Unicode setup, only the KEYMAP and FONT variables are
  381. generally needed. E.g., for a Polish setup, one would use:</para>
  382. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  383. <literal># Begin /etc/sysconfig/console
  384. KEYMAP="pl2"
  385. FONT="lat2a-16 -m 8859-2"
  386. # End /etc/sysconfig/console</literal>
  387. EOF</userinput></screen>
  388. </listitem>
  389. <listitem>
  390. <para>As mentioned above, it is sometimes necessary to adjust a
  391. stock keymap slightly. The following example adds the Euro symbol to the
  392. German keymap:</para>
  393. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  394. <literal># Begin /etc/sysconfig/console
  395. KEYMAP="de-latin1"
  396. KEYMAP_CORRECTIONS="euro2"
  397. FONT="lat0-16 -m 8859-15"
  398. UNICODE="1"
  399. # End /etc/sysconfig/console</literal>
  400. EOF</userinput></screen>
  401. </listitem>
  402. <listitem>
  403. <para>The following is a Unicode-enabled example for Bulgarian, where a
  404. stock UTF-8 keymap exists:</para>
  405. <!-- This is what is used by jhalfs for creating the console file: whenever
  406. you change the following, please inform the jhalfs maintainer(s). -->
  407. <screen><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  408. <literal># Begin /etc/sysconfig/console
  409. UNICODE="1"
  410. KEYMAP="bg_bds-utf8"
  411. FONT="LatArCyrHeb-16"
  412. # End /etc/sysconfig/console</literal>
  413. EOF</userinput></screen>
  414. </listitem>
  415. <listitem>
  416. <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous
  417. example, bright colors are no longer available on the Linux console unless
  418. a framebuffer is used. If one wants to have bright colors without
  419. framebuffer and can live without characters not belonging to his language,
  420. it is still possible to use a language-specific 256-glyph font, as
  421. illustrated below:</para>
  422. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  423. <literal># Begin /etc/sysconfig/console
  424. UNICODE="1"
  425. KEYMAP="bg_bds-utf8"
  426. FONT="cyr-sun16"
  427. # End /etc/sysconfig/console</literal>
  428. EOF</userinput></screen>
  429. </listitem>
  430. <listitem>
  431. <para>The following example illustrates keymap autoconversion from
  432. ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:</para>
  433. <screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
  434. <literal># Begin /etc/sysconfig/console
  435. UNICODE="1"
  436. KEYMAP="de-latin1"
  437. KEYMAP_CORRECTIONS="euro2"
  438. LEGACY_CHARSET="iso-8859-15"
  439. FONT="LatArCyrHeb-16 -m 8859-15"
  440. # End /etc/sysconfig/console</literal>
  441. EOF</userinput></screen>
  442. </listitem>
  443. <listitem>
  444. <para>Some keymaps have dead keys (i.e., keys that don't produce a
  445. character by themselves, but put an accent on the character produced
  446. by the next key) or define composition rules (such as: <quote>press
  447. Ctrl+. A E to get &AElig;</quote> in the default keymap).
  448. Linux-&linux-version; interprets dead keys and composition rules in the
  449. keymap correctly only when the source characters to be composed together
  450. are not multibyte. This deficiency doesn't affect keymaps for European
  451. languages, because there accents are added to unaccented ASCII
  452. characters, or two ASCII characters are composed together. However, in
  453. UTF-8 mode it is a problem, e.g., for the Greek language, where one
  454. sometimes needs to put an accent on the letter <quote>alpha</quote>.
  455. The solution is either to avoid the use of UTF-8, or to install the
  456. X window system that doesn't have this limitation in its input
  457. handling.</para>
  458. </listitem>
  459. <listitem>
  460. <para>For Chinese, Japanese, Korean and some other languages, the Linux
  461. console cannot be configured to display the needed characters. Users
  462. who need such languages should install the X Window System, fonts that
  463. cover the necessary character ranges, and the proper input method (e.g.,
  464. SCIM, it supports a wide variety of languages).</para>
  465. </listitem>
  466. </itemizedlist>
  467. <!-- Added because folks keep posting their console file with X questions
  468. to blfs-support list -->
  469. <note>
  470. <para>The <filename>/etc/sysconfig/console</filename> file only controls
  471. the Linux text console localization. It has nothing to do with setting
  472. the proper keyboard layout and terminal fonts in the X Window System, with
  473. ssh sessions or with a serial console. In such situations, limitations
  474. mentioned in the last two list items above do not apply.</para>
  475. </note>
  476. </sect2>
  477. <sect2 id="ch-scripts-createfiles">
  478. <title>Creating Files at Boot</title>
  479. <indexterm zone="ch-scripts-createfiles">
  480. <primary sortas="d-createfiles">File creation at boot</primary>
  481. <secondary>configuring</secondary>
  482. </indexterm>
  483. <para>At times, it is desired to create files at boot time. For instance,
  484. the <filename class="directory">/tmp/.ICE-unix</filename> directory
  485. may be desired. This can be done by creating an entry in the
  486. <filename>/etc/sysconfig/createfiles</filename> configuration script.
  487. The format of this file is embedded in the comments of the default
  488. configuration file.</para>
  489. </sect2>
  490. <sect2 id="ch-scripts-sysklogd">
  491. <title>Configuring the sysklogd Script</title>
  492. <indexterm zone="ch-scripts-sysklogd">
  493. <primary sortas="d-sysklogd">sysklogd</primary>
  494. <secondary>configuring</secondary>
  495. </indexterm>
  496. <para>The <filename>sysklogd</filename> script invokes the
  497. <command>syslogd</command> program as a part of System V initialization. The
  498. <parameter>-m 0</parameter> option turns off the periodic timestamp mark that
  499. <command>syslogd</command> writes to the log files every 20 minutes by
  500. default. If you want to turn on this periodic timestamp mark, edit
  501. <filename>/etc/sysconfig/rc.site</filename> and define the variable
  502. SYSKLOGD_PARMS to the desired value. For instance, to remove all parameters,
  503. set the variable to a null value:</para>
  504. <screen role="nodump">SYSKLOGD_PARMS=</screen>
  505. <para>See <userinput>man syslogd</userinput> for more options.</para>
  506. </sect2>
  507. <sect2 id="ch-scripts-site">
  508. <title>The rc.site File</title>
  509. <indexterm zone="ch-scripts-site">
  510. <primary sortas="a-rc.site">rc.site</primary>
  511. </indexterm>
  512. <para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains
  513. settings that are automatically set for each SystemV boot script. It can
  514. alternatively set the values specified in the <filename>hostname</filename>,
  515. <filename>console</filename>, and <filename>clock</filename> files in the
  516. <filename class='directory'>/etc/sysconfig/</filename> directory. If the
  517. associated variables are present in both these separate files and
  518. <filename>rc.site</filename>, the values in the script specific files have
  519. precedence. </para>
  520. <para><filename>rc.site</filename> also contains parameters that can
  521. customize other aspects of the boot process. Setting the IPROMPT variable
  522. will enable selective running of bootscripts. Other options are described
  523. in the file comments. The default version of the file is as follows:</para>
  524. <!-- Use role to fix a pdf generation problem -->
  525. <screen role="auto">&site;</screen>
  526. <sect3>
  527. <title>Customizing the Boot and Shutdown Scripts</title>
  528. <para>The LFS boot scripts boot and shut down a system in a fairly
  529. efficient manner, but there are a few tweaks that you can make in the
  530. rc.site file to improve speed even more and to adjust messages according
  531. to your preferences. To do this, adjust the settings in
  532. the <filename>/etc/sysconfig/rc.site</filename> file above.</para>
  533. <itemizedlist>
  534. <listitem><para>During the boot script <filename>udev</filename>, there is
  535. a call to <command>udev settle</command> that requires some time to
  536. complete. This time may or may not be required depending on devices present
  537. in the system. If you only have simple partitions and a single ethernet
  538. card, the boot process will probably not need to wait for this command. To
  539. skip it, set the variable OMIT_UDEV_SETTLE=y.</para></listitem>
  540. <listitem><para>The boot script <filename>udev_retry</filename> also runs
  541. <command>udev settle</command> by default. This command is only needed by
  542. default if the <filename class='directory'>/var</filename> directory is
  543. separately mounted. This is because the clock needs the file
  544. <filename>/var/lib/hwclock/adjtime</filename>. Other customizations may
  545. also need to wait for udev to complete, but in many installations it is not
  546. needed. Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y.
  547. </para></listitem>
  548. <listitem><para>By default, the file system checks are silent. This can
  549. appear to be a delay during the bootup process. To turn on the
  550. <command>fsck</command> output, set the variable VERBOSE_FSCK=y.
  551. </para></listitem>
  552. <listitem><para>When rebooting, you may want to skip the filesystem check,
  553. <command>fsck</command>, completely. To do this, either create the file
  554. <filename>/fastboot</filename> or reboot the system with the command
  555. <command>/sbin/shutdown -f -r now</command>. On the other hand, you can
  556. force all file systems to be checked by creating
  557. <filename>/forcefsck</filename> or running <command>shutdown</command> with
  558. the <parameter>-F</parameter> parameter instead of <parameter>-f</parameter>.
  559. </para>
  560. <para>Setting the variable FASTBOOT=y will disable <command>fsck</command>
  561. during the boot process until it is removed. This is not recommended
  562. on a permanent basis.</para></listitem>
  563. <listitem><para>Normally, all files in the <filename
  564. class='directory'>/tmp</filename> directory are deleted at boot time.
  565. Depending on the number of files or directories present, this can cause a
  566. noticeable delay in the boot process. To skip removing these files set the
  567. variable SKIPTMPCLEAN=y.</para></listitem>
  568. <listitem><para>During shutdown, the <command>init</command> program sends
  569. a TERM signal to each program it has started (e.g. agetty), waits for a set
  570. time (default 3 seconds), and sends each process a KILL signal and waits
  571. again. This process is repeated in the <command>sendsignals</command>
  572. script for any processes that are not shut down by their own scripts. The
  573. delay for <command>init</command> can be set by passing a parameter. For
  574. example to remove the delay in <command>init</command>, pass the -t0
  575. parameter when shutting down or rebooting (e.g. <command>/sbin/shutdown
  576. -t0 -r now</command>). The delay for the <command>sendsignals</command>
  577. script can be skipped by setting the parameter
  578. KILLDELAY=0.</para></listitem>
  579. </itemizedlist>
  580. </sect3>
  581. </sect2>
  582. </sect1>