usage.xml 31 KB

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