usage.xml 30 KB

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