source: chapter09/usage.xml

trunk
Last change on this file was 39b5bb6, checked in by Xi Ruoyao <xry111@…>, 3 months ago

console font: Add more "working for C.UTF-8" console fonts

  • Property mode set to 100644
File size: 30.9 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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
9<sect1 id="ch-config-usage" revision="sysv">
10 <?dbhtml filename="usage.html"?>
11
12 <title>System V Bootscript Usage and Configuration</title>
13
14 <indexterm zone="ch-config-usage">
15 <primary sortas="a-Bootscripts">Bootscripts</primary>
16 <secondary>usage</secondary>
17 </indexterm>
18
19 <sect2>
20 <title>How Do the System V Bootscripts Work?</title>
21
22 <para>This version of LFS uses a special booting facility named SysVinit, based on a
23 series of <emphasis>run levels</emphasis>. The boot procedure can be quite different from one
24 system to another; the fact that things worked one way in a particular Linux
25 distribution does not guarantee they will work the same way in LFS. LFS has its
26 own way of doing things, but it does respect generally accepted standards.</para>
27
28 <para>There is an alternative boot procedure called <command>systemd</command>. We will
29 not discuss that boot process any further here. For a detailed description visit
30 <ulink url="https://www.linux.com/training-tutorials/understanding-and-using-systemd/"/>.</para>
31
32 <para>SysVinit (which will be referred to as <quote>init</quote> from now on)
33 uses a run levels scheme. There are seven run levels, numbered 0 to 6.
34 (Actually, there are more run levels, but the others are for special cases and are
35 generally not used. See <ulink role='man'
36 url='&man;init.8'>init(8)</ulink> for more details.)
37 Each one of the seven corresponds to actions the computer is supposed to
38 perform when it starts up or shuts down. The default run level is 3. Here are the
39 descriptions of the different run levels as they are implemented in LFS:</para>
40
41<literallayout>0: halt the computer
421: single-user mode
432: reserved for customization, otherwise the same as 3
443: multi-user mode with networking
454: reserved for customization, otherwise the same as 3
465: same as 4, it is usually used for GUI login (like GNOME's <command>gdm</command> or LXDE's <command>lxdm</command>)
476: reboot the computer</literallayout>
48
49 <note>
50 <para>
51 Classically, run level 2 above was defined as <quote>multi-user
52 mode without networking,</quote> but this was only the case
53 many years ago when multiple users could connect to a system via
54 serial ports. In today's environment it makes no sense, and
55 we now say it is <quote>reserved.</quote>
56 </para>
57 </note>
58
59 </sect2>
60
61 <sect2 id="conf-sysvinit" role="configuration">
62 <title>Configuring Sysvinit</title>
63
64 <indexterm zone="conf-sysvinit">
65 <primary sortas="a-Sysvinit">Sysvinit</primary>
66 <secondary>configuring</secondary>
67 </indexterm>
68
69 <indexterm zone="conf-sysvinit">
70 <primary sortas="e-/etc/inittab">/etc/inittab</primary>
71 </indexterm>
72
73 <para>During kernel initialization, the first program that is run
74 (if not overridden on the command line) is
75 <command>init</command>. This program reads the initialization file
76 <filename>/etc/inittab</filename>. Create this file with:</para>
77
78<screen><userinput>cat &gt; /etc/inittab &lt;&lt; "EOF"
79<literal># Begin /etc/inittab
80
81id:3:initdefault:
82
83si::sysinit:/etc/rc.d/init.d/rc S
84
85l0:0:wait:/etc/rc.d/init.d/rc 0
86l1:S1:wait:/etc/rc.d/init.d/rc 1
87l2:2:wait:/etc/rc.d/init.d/rc 2
88l3:3:wait:/etc/rc.d/init.d/rc 3
89l4:4:wait:/etc/rc.d/init.d/rc 4
90l5:5:wait:/etc/rc.d/init.d/rc 5
91l6:6:wait:/etc/rc.d/init.d/rc 6
92
93ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
94
95su:S06:once:/sbin/sulogin
96s1:1:respawn:/sbin/sulogin
97
981:2345:respawn:/sbin/agetty --noclear tty1 9600
992:2345:respawn:/sbin/agetty tty2 9600
1003:2345:respawn:/sbin/agetty tty3 9600
1014:2345:respawn:/sbin/agetty tty4 9600
1025:2345:respawn:/sbin/agetty tty5 9600
1036:2345:respawn:/sbin/agetty tty6 9600
104
105# End /etc/inittab</literal>
106EOF</userinput></screen>
107
108 <para>An explanation of this initialization file is in the man page for
109 <emphasis>inittab</emphasis>. In LFS, the key command is
110 <command>rc</command>. The initialization file above instructs
111 <command>rc</command> to run all the scripts starting with an S in the
112 <filename class="directory">/etc/rc.d/rcS.d</filename> directory
113 followed by all the scripts starting with an S in the <filename
114 class="directory">/etc/rc.d/rc?.d</filename> directory where the question
115 mark is specified by the initdefault value.</para>
116
117 <para>As a convenience, the <command>rc</command> script reads a library of
118 functions in <filename class="directory">/lib/lsb/init-functions</filename>.
119 This library also reads an optional configuration file,
120 <filename>/etc/sysconfig/rc.site</filename>. Any of the system
121 configuration parameters described in subsequent sections can be
122 placed in this file, allowing consolidation of all system
123 parameters in this one file.</para>
124
125 <para>As a debugging convenience, the functions script also logs all output
126 to <filename>/run/var/bootlog</filename>. Since the <filename
127 class="directory">/run</filename> directory is a tmpfs, this file is not
128 persistent across boots; however, it is appended to the more permanent file
129 <filename>/var/log/boot.log</filename> at the end of the boot process.</para>
130
131 <sect3 id="init-levels" >
132 <title>Changing Run Levels</title>
133
134 <para>Changing run levels is done with <command>init
135 <replaceable>&lt;runlevel&gt;</replaceable></command>, where
136 <replaceable>&lt;runlevel&gt;</replaceable> is the target run level. For example, to
137 reboot the computer, a user could issue the <command>init 6</command> command,
138 which is an alias for the <command>reboot</command> command. Likewise,
139 <command>init 0</command> is an alias for the <command>halt</command>
140 command.</para>
141
142 <para>There are a number of directories under <filename
143 class="directory">/etc/rc.d</filename> that look like <filename
144 class="directory">rc?.d</filename> (where ? is the number of the run level) and
145 <filename class="directory">rcS.d</filename>, all containing a number of
146 symbolic links. Some links begin with a <emphasis>K</emphasis>; the others begin with
147 an <emphasis>S</emphasis>, and all of them have two numbers following the
148 initial letter. The K means to stop (kill) a service and the S means to start a
149 service. The numbers determine the order in which the scripts are run, from 00
150 to 99&mdash;the smaller the number, the sooner the script runs. When
151 <command>init</command> switches to another run level, the appropriate services
152 are either started or stopped, depending on the run level chosen.</para>
153
154 <para>The real scripts are in <filename
155 class="directory">/etc/rc.d/init.d</filename>. They do the actual work, and
156 the symlinks all point to them. K links and S links point to
157 the same script in <filename class="directory">/etc/rc.d/init.d</filename>.
158 This is because the scripts can be called with different parameters like
159 <parameter>start</parameter>, <parameter>stop</parameter>,
160 <parameter>restart</parameter>, <parameter>reload</parameter>, and
161 <parameter>status</parameter>. When a K link is encountered, the appropriate
162 script is run with the <parameter>stop</parameter> argument. When an S link
163 is encountered, the appropriate script is run with the
164 <parameter>start</parameter> argument.</para>
165<!-- Changed for March 24th, 2022 version of bootscripts
166 <para>There is one exception to this explanation. Links that start
167 with an <emphasis>S</emphasis> in the <filename
168 class="directory">rc0.d</filename> and <filename
169 class="directory">rc6.d</filename> directories will not cause anything
170 to be started. They will be called with the parameter
171 <parameter>stop</parameter> to stop something. The logic behind this
172 is that when a user is going to reboot or halt the system, nothing
173 needs to be started, but the order of shutdown needs to be controlled.
174 For these run levels, all <emphasis>K</emphasis> prefixed scripts will be
175 run before any <emphasis>S</emphasis> prefixed scripts are run with the
176 <parameter>stop</parameter> parameter.
177 </para>
178-->
179 <para>These are descriptions of what the arguments make the scripts
180 do:</para>
181
182 <variablelist>
183
184 <varlistentry>
185 <term><parameter>start</parameter></term>
186 <listitem>
187 <para>The service is started.</para>
188 </listitem>
189 </varlistentry>
190
191 <varlistentry>
192 <term><parameter>stop</parameter></term>
193 <listitem>
194 <para>The service is stopped.</para>
195 </listitem>
196 </varlistentry>
197
198 <varlistentry>
199 <term><parameter>restart</parameter></term>
200 <listitem>
201 <para>The service is stopped and then started again.</para>
202 </listitem>
203 </varlistentry>
204
205 <varlistentry>
206 <term><parameter>reload</parameter></term>
207 <listitem>
208 <para>The configuration of the service is updated.
209 This is used after the configuration file of a service was modified, when
210 the service does not need to be restarted.</para>
211 </listitem>
212 </varlistentry>
213
214 <varlistentry>
215 <term><parameter>status</parameter></term>
216 <listitem>
217 <para>Tells if the service is running and with which PIDs.</para>
218 </listitem>
219 </varlistentry>
220
221 </variablelist>
222
223 <para>Feel free to modify the way the boot process works (after all,
224 it is your own LFS system). The files given here are an example of how
225 it can be done.</para>
226
227 </sect3>
228 </sect2>
229
230 <sect2>
231 <title>Udev Bootscripts</title>
232
233 <para>The <filename>/etc/rc.d/init.d/udev</filename> initscript starts
234 <command>udevd</command>, triggers any "coldplug" devices that have
235 already been created by the kernel, and waits for any rules to complete.
236 The script also unsets the uevent handler from the default of
237 <filename>/sbin/hotplug </filename>. This is done because the kernel no
238 longer needs to call an external binary. Instead,
239 <command>udevd</command> will listen on a netlink socket for uevents that
240 the kernel raises.</para>
241
242 <para>The <command>/etc/rc.d/init.d/udev_retry</command> script takes
243 care of re-triggering events for subsystems whose rules may rely on
244 file systems that are not mounted until the <command>mountfs</command>
245 script is run (in particular, <filename class="directory">/usr</filename>
246 and <filename class="directory">/var</filename> may cause this). This
247 script runs after the <command>mountfs</command> script, so those rules
248 (if re-triggered) should succeed the second time around. It is
249 configured by the <filename>/etc/sysconfig/udev_retry</filename> file;
250 any words in this file other than comments are considered subsystem names
251 to trigger at retry time. To find the subsystem of a device, use
252 <command>udevadm info --attribute-walk &lt;device&gt;</command> where
253 &lt;device&gt; is an absolute path in /dev or /sys, such as /dev/sr0, or
254 /sys/class/rtc.</para>
255
256 <para>For information on kernel module loading and udev, see
257 <xref linkend="module-loading"/>.</para>
258 </sect2>
259
260 <sect2 id="ch-config-clock">
261 <title>Configuring the System Clock</title>
262
263 <indexterm zone="ch-config-clock">
264 <primary sortas="d-setclock">setclock</primary>
265 <secondary>configuring</secondary></indexterm>
266
267 <para>The <command>setclock</command> script reads the time from the hardware
268 clock, also known as the BIOS or Complementary Metal Oxide Semiconductor
269 (CMOS) clock. If the hardware clock is set to UTC, this script will convert the
270 hardware clock's time to the local time using the
271 <filename>/etc/localtime</filename> file (which tells the
272 <command>hwclock</command> program which time zone to use). There is no
273 way to detect whether or not the hardware clock is set to UTC, so this
274 must be configured manually.</para>
275
276 <para>The <command>setclock</command> program is run via
277 <application>udev</application> when the kernel detects the hardware
278 capability upon boot. It can also be run manually with the stop parameter to
279 store the system time to the CMOS clock.</para>
280
281 <para>If you cannot remember whether or not the hardware clock is set to UTC,
282 find out by running the <userinput>hwclock --localtime --show</userinput>
283 command. This will display what the current time is according to the hardware
284 clock. If this time matches whatever your watch says, then the hardware clock is
285 set to local time. If the output from <command>hwclock</command> is not local
286 time, chances are it is set to UTC time. Verify this by adding or subtracting
287 the proper number of hours for your time zone to the time shown by
288 <command>hwclock</command>. For example, if you are currently in the MST
289 time zone, which is also known as GMT -0700, add seven hours to the local
290 time.</para>
291
292 <para>Change the value of the <envar>UTC</envar> variable below
293 to a value of <parameter>0</parameter> (zero) if the hardware clock
294 is <emphasis>NOT</emphasis> set to UTC time.</para>
295
296 <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
297 the following:</para>
298
299<screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"
300<literal># Begin /etc/sysconfig/clock
301
302UTC=1
303
304# Set this to any options you might need to give to hwclock,
305# such as machine hardware clock type for Alphas.
306CLOCKPARAMS=
307
308# End /etc/sysconfig/clock</literal>
309EOF</userinput></screen>
310
311 <para>A good hint explaining how to deal with time on LFS is available
312 at <ulink url="&hints-root;time.txt"/>. It explains issues such as
313 time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
314
315 <note><para>The CLOCKPARAMS and UTC parameters may also be set
316 in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note>
317
318 </sect2>
319
320 <sect2 id="ch-config-console">
321 <?dbhtml filename="console.html"?>
322
323 <title>Configuring the Linux Console</title>
324
325 <indexterm zone="ch-config-console">
326 <primary sortas="d-console">console</primary>
327 <secondary>configuring</secondary>
328 </indexterm>
329
330 <para>This section discusses how to configure the <command>console</command>
331 bootscript that sets up the keyboard map, console font, and console kernel log
332 level. If non-ASCII characters (e.g., the copyright sign, the British pound
333 sign, and the Euro symbol) will not be used and the keyboard is a U.S. one, much
334 of this section can be skipped. Without the configuration file, (or
335 equivalent settings in <filename>rc.site</filename>), the
336 <command>console</command> bootscript will do nothing.</para>
337
338 <para>The <command>console</command> script reads the
339 <filename>/etc/sysconfig/console</filename> file for configuration
340 information. Decide which keymap and screen font will be used. Various
341 language-specific HOWTOs can also help with this; see <ulink
342 url="https://tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in
343 doubt, look in the <filename class="directory">/usr/share/keymaps</filename>
344 and <filename class="directory">/usr/share/consolefonts</filename> directories
345 for valid keymaps and screen fonts. Read the <ulink role='man'
346 url='&man;loadkeys.1'>loadkeys(1)</ulink> and <ulink role='man'
347 url='&man;setfont.8'>setfont(8)</ulink> manual pages to determine the
348 correct arguments for these programs.</para>
349
350 <para>The <filename>/etc/sysconfig/console</filename> file should contain lines
351 of the form: <envar>VARIABLE=value</envar>. The following variables are recognized:</para>
352 <variablelist>
353
354 <varlistentry>
355 <term>LOGLEVEL</term>
356 <listitem>
357 <para>This variable specifies the log level for kernel messages sent
358 to the console as set by <command>dmesg -n</command>. Valid levels are
359 from <literal>1</literal> (no messages) to <literal>8</literal>. The default level is <literal>7</literal>, which is quite verbose.</para>
360 </listitem>
361 </varlistentry>
362
363 <varlistentry>
364 <term>KEYMAP</term>
365 <listitem>
366 <para>This variable specifies the arguments for the
367 <command>loadkeys</command> program, typically, the name of the keymap
368 to load, e.g., <literal>it</literal>. If this variable is not set, the
369 bootscript will not run the <command>loadkeys</command> program,
370 and the default kernel keymap will be used. Note that a few keymaps
371 have multiple versions with the same name (cz and its variants in
372 qwerty/ and qwertz/, es in olpc/ and qwerty/, and trf in fgGIod/ and
373 qwerty/). In these cases the parent directory should also be specified
374 (e.g. qwerty/es) to ensure the proper keymap is loaded.
375 </para>
376 </listitem>
377 </varlistentry>
378
379 <varlistentry>
380 <term>KEYMAP_CORRECTIONS</term>
381 <listitem>
382 <para>This (rarely used) variable
383 specifies the arguments for the second call to the
384 <command>loadkeys</command> program. This is useful if the stock keymap
385 is not completely satisfactory and a small adjustment has to be made. E.g.,
386 to include the Euro sign into a keymap that normally doesn't have it,
387 set this variable to <literal>euro2</literal>.</para>
388 </listitem>
389 </varlistentry>
390
391 <varlistentry>
392 <term>FONT</term>
393 <listitem>
394 <para>This variable specifies the arguments for the
395 <command>setfont</command> program. Typically, this includes the font
396 name, <literal>-m</literal>, and the name of the application character
397 map to load. E.g., in order to load the <quote>lat1-16</quote> font
398 together with the <quote>8859-1</quote> application character map
399 (appropriate in the USA),
400 <!-- because of the copyright sign -->
401 set this variable to <literal>lat1-16 -m 8859-1</literal>.
402 In UTF-8 mode, the kernel uses the application character map to
403 convert 8-bit key codes to UTF-8. Therefore
404 the argument of the "-m" parameter should be set to the encoding of the
405 composed key codes in the keymap.</para>
406
407 </listitem>
408 </varlistentry>
409
410 <varlistentry>
411 <term>UNICODE</term>
412 <listitem>
413 <para>Set this variable to <literal>1</literal>, <literal>yes</literal>, or
414 <literal>true</literal> in order to put the
415 console into UTF-8 mode. This is useful in UTF-8 based locales and
416 harmful otherwise.</para>
417 </listitem>
418 </varlistentry>
419
420 <varlistentry>
421 <term>LEGACY_CHARSET</term>
422 <listitem>
423 <para>For many keyboard layouts, there is no stock Unicode keymap in
424 the Kbd package. The <command>console</command> bootscript will
425 convert an available keymap to UTF-8 on the fly if this variable is
426 set to the encoding of the available non-UTF-8 keymap.</para>
427 </listitem>
428 </varlistentry>
429
430 </variablelist>
431
432 <para>Some examples:</para>
433
434 <itemizedlist>
435 <listitem>
436 <para>
437 We'll use <literal>C.UTF-8</literal> as the locale for interactive
438 sessions in the Linux console in <xref role=','
439 linkend='ch-config-locale'/> so we should set
440 <literal>UNICODE</literal> to <literal>1</literal>. And the console
441 fonts shipped by the <application>Kbd</application> package
442 containing the glyphs for all characters from the program messages
443 in the <literal>C.UTF-8</literal> locale are
444 <filename>LatArCyrHeb*.psfu.gz</filename>,
445 <filename>LatGrkCyr*.psfu.gz</filename>,
446 <filename>Lat2-Terminus16.psfu.gz</filename>, and
447 <filename>pancyrillic.f16.psfu.gz</filename> in
448 <filename class='directory'>/usr/share/consolefonts</filename> (the
449 other shipped console fonts lack glyphs of some characters like the
450 Unicode left/right quotation marks and the Unicode English dash).
451 So set one of them, for example
452 <filename>Lat2-Terminus16.psfu.gz</filename> as the default console
453 font:
454 </para>
455
456 <!-- We are using 'nodump' for the generic setting, but not for an
457 example (see below). This is deliberate to keep the
458 compatibility with jhalfs. -->
459<screen role='nodump'><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
460<literal># Begin /etc/sysconfig/console
461
462UNICODE="1"
463FONT="Lat2-Terminus16"
464
465# End /etc/sysconfig/console</literal>
466EOF</userinput></screen>
467
468 </listitem>
469
470 <listitem>
471 <para>For a non-Unicode setup, only the KEYMAP and FONT variables are
472 generally needed. E.g., for a Polish setup, one would use:</para>
473<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
474<literal># Begin /etc/sysconfig/console
475
476KEYMAP="pl2"
477FONT="lat2a-16 -m 8859-2"
478
479# End /etc/sysconfig/console</literal>
480EOF</userinput></screen>
481 </listitem>
482
483 <listitem>
484 <para>As mentioned above, it is sometimes necessary to adjust a
485 stock keymap slightly. The following example adds the Euro symbol to the
486 German keymap:</para>
487
488<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
489<literal># Begin /etc/sysconfig/console
490
491KEYMAP="de-latin1"
492KEYMAP_CORRECTIONS="euro2"
493FONT="lat0-16 -m 8859-15"
494UNICODE="1"
495
496# End /etc/sysconfig/console</literal>
497EOF</userinput></screen>
498 </listitem>
499
500 <listitem>
501 <para>The following is a Unicode-enabled example for Bulgarian, where a
502 stock UTF-8 keymap exists:</para>
503<!-- This is what is used by jhalfs for creating the console file: whenever
504 you change the following, please inform the jhalfs maintainer(s). -->
505<screen><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
506<literal># Begin /etc/sysconfig/console
507
508UNICODE="1"
509KEYMAP="bg_bds-utf8"
510FONT="LatArCyrHeb-16"
511
512# End /etc/sysconfig/console</literal>
513EOF</userinput></screen>
514 </listitem>
515
516 <listitem>
517 <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous
518 example, bright colors are no longer available on the Linux console unless
519 a framebuffer is used. If one wants to have bright colors without a
520 framebuffer and can live without characters not belonging to his language,
521 it is still possible to use a language-specific 256-glyph font, as
522 illustrated below:</para>
523
524<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
525<literal># Begin /etc/sysconfig/console
526
527UNICODE="1"
528KEYMAP="bg_bds-utf8"
529FONT="cyr-sun16"
530
531# End /etc/sysconfig/console</literal>
532EOF</userinput></screen>
533 </listitem>
534
535 <listitem>
536 <para>The following example illustrates keymap autoconversion from
537 ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:</para>
538
539<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
540<literal># Begin /etc/sysconfig/console
541
542UNICODE="1"
543KEYMAP="de-latin1"
544KEYMAP_CORRECTIONS="euro2"
545LEGACY_CHARSET="iso-8859-15"
546FONT="LatArCyrHeb-16 -m 8859-15"
547
548# End /etc/sysconfig/console</literal>
549EOF</userinput></screen>
550 </listitem>
551
552 <listitem>
553 <para>Some keymaps have dead keys (i.e., keys that don't produce a
554 character by themselves, but put an accent on the character produced
555 by the next key) or define composition rules (such as: <quote>press
556 Ctrl+. A E to get &AElig;</quote> in the default keymap).
557 Linux-&linux-version; interprets dead keys and composition rules in the
558 keymap correctly only when the source characters to be composed together
559 are not multibyte. This deficiency doesn't affect keymaps for European
560 languages, because there accents are added to unaccented ASCII
561 characters, or two ASCII characters are composed together. However, in
562 UTF-8 mode it is a problem; e.g., for the Greek language, where one
563 sometimes needs to put an accent on the letter α.
564 The solution is either to avoid the use of UTF-8, or to install the
565 X window system, which doesn't have this limitation, in its input
566 handling.</para>
567 </listitem>
568
569 <listitem>
570 <para>For Chinese, Japanese, Korean, and some other languages, the Linux
571 console cannot be configured to display the needed characters. Users
572 who need such languages should install the X Window System, fonts that
573 cover the necessary character ranges, and the proper input method (e.g.,
574 SCIM supports a wide variety of languages).</para>
575 </listitem>
576
577 </itemizedlist>
578
579 <!-- Added because folks keep posting their console file with X questions
580 to blfs-support list -->
581 <note>
582 <para>The <filename>/etc/sysconfig/console</filename> file only controls
583 the Linux text console localization. It has nothing to do with setting
584 the proper keyboard layout and terminal fonts in the X Window System, with
585 ssh sessions, or with a serial console. In such situations, limitations
586 mentioned in the last two list items above do not apply.</para>
587 </note>
588
589 </sect2>
590
591 <sect2 id="ch-config-createfiles">
592 <title>Creating Files at Boot</title>
593
594 <indexterm zone="ch-config-createfiles">
595 <primary sortas="d-createfiles">File creation at boot</primary>
596 <secondary>configuring</secondary>
597 </indexterm>
598
599 <para>At times, it is desirable to create files at boot time. For instance,
600 the <filename class="directory">/tmp/.ICE-unix</filename> directory
601 is often needed. This can be done by creating an entry in the
602 <filename>/etc/sysconfig/createfiles</filename> configuration script.
603 The format of this file is embedded in the comments of the default
604 configuration file.</para>
605 </sect2>
606
607 <sect2 id="ch-config-sysklogd">
608 <title>Configuring the Sysklogd Script</title>
609
610 <indexterm zone="ch-config-sysklogd">
611 <primary sortas="d-sysklogd">sysklogd</primary>
612 <secondary>configuring</secondary>
613 </indexterm>
614
615 <para>The <filename>sysklogd</filename> script invokes the
616 <command>syslogd</command> program as a part of System V initialization. The
617 <parameter>-m 0</parameter> option turns off the periodic timestamp mark that
618 <command>syslogd</command> writes to the log files every 20 minutes by
619 default. If you want to turn on this periodic timestamp mark, edit
620 <filename>/etc/sysconfig/rc.site</filename> and define the variable
621 SYSKLOGD_PARMS to the desired value. For instance, to remove all parameters,
622 set the variable to a null value:</para>
623
624<screen role="nodump">SYSKLOGD_PARMS=</screen>
625
626 <para>See <userinput>man syslogd</userinput> for more options.</para>
627
628 </sect2>
629
630 <sect2 id="ch-config-site">
631 <title>The rc.site File</title>
632
633 <indexterm zone="ch-config-site">
634 <primary sortas="a-rc.site">rc.site</primary>
635 </indexterm>
636
637 <para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains
638 settings that are automatically set for each SystemV boot script. It can
639 alternatively set the values specified in the <filename>hostname</filename>,
640 <filename>console</filename>, and <filename>clock</filename> files in the
641 <filename class='directory'>/etc/sysconfig/</filename> directory. If the
642 associated variables are present in both these separate files and
643 <filename>rc.site</filename>, the values in the script-specific files take
644 effect. </para>
645
646 <para><filename>rc.site</filename> also contains parameters that can
647 customize other aspects of the boot process. Setting the IPROMPT variable
648 will enable selective running of bootscripts. Other options are described
649 in the file comments. The default version of the file is as follows:</para>
650
651 <!-- Use role to fix a pdf generation problem -->
652 <screen role="auto">&site;</screen>
653
654 <sect3>
655 <title>Customizing the Boot and Shutdown Scripts</title>
656
657 <para>The LFS boot scripts boot and shut down a system in a fairly
658 efficient manner, but there are a few tweaks you can make in the
659 rc.site file to improve speed even more, and to adjust messages according
660 to your preferences. To do this, adjust the settings in
661 the <filename>/etc/sysconfig/rc.site</filename> file above.</para>
662
663 <itemizedlist>
664
665 <listitem><para>During the boot script <filename>udev</filename>, there is
666 a call to <command>udev settle</command> that requires some time to
667 complete. This time may or may not be required depending on the devices
668 in the system. If you only have simple partitions and a single ethernet
669 card, the boot process will probably not need to wait for this command. To
670 skip it, set the variable OMIT_UDEV_SETTLE=y.</para></listitem>
671
672 <listitem><para>The boot script <filename>udev_retry</filename> also runs
673 <command>udev settle</command> by default. This command is only needed
674 if the <filename class='directory'>/var</filename> directory is
675 separately mounted, because the clock needs the
676 <filename>/var/lib/hwclock/adjtime</filename> file. Other customizations may
677 also need to wait for udev to complete, but in many installations it is not
678 necessary. Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y.
679 </para></listitem>
680
681 <listitem><para>By default, the file system checks are silent. This can
682 appear to be a delay during the bootup process. To turn on the
683 <command>fsck</command> output, set the variable VERBOSE_FSCK=y.
684 </para></listitem>
685
686 <listitem><para>When rebooting, you may want to skip the filesystem check,
687 <command>fsck</command>, completely. To do this, either create the file
688 <filename>/fastboot</filename> or reboot the system with the command
689 <command>/sbin/shutdown -f -r now</command>. On the other hand, you can
690 force all file systems to be checked by creating
691 <filename>/forcefsck</filename> or running <command>shutdown</command> with
692 the <parameter>-F</parameter> parameter instead of <parameter>-f</parameter>.
693 </para>
694
695 <para>Setting the variable FASTBOOT=y will disable <command>fsck</command>
696 during the boot process until it is removed. This is not recommended
697 on a permanent basis.</para></listitem>
698
699 <listitem><para>Normally, all files in the <filename
700 class='directory'>/tmp</filename> directory are deleted at boot time.
701 Depending on the number of files or directories present, this can cause a
702 noticeable delay in the boot process. To skip removing these files set the
703 variable SKIPTMPCLEAN=y.</para></listitem>
704
705 <listitem><para>During shutdown, the <command>init</command> program sends
706 a TERM signal to each program it has started (e.g. agetty), waits for a set
707 time (default 3 seconds), then sends each process a KILL signal and waits
708 again. This process is repeated in the <command>sendsignals</command>
709 script for any processes that are not shut down by their own scripts. The
710 delay for <command>init</command> can be set by passing a parameter. For
711 example to remove the delay in <command>init</command>, pass the -t0
712 parameter when shutting down or rebooting (e.g. <command>/sbin/shutdown
713 -t0 -r now</command>). The delay for the <command>sendsignals</command>
714 script can be skipped by setting the parameter
715 KILLDELAY=0.</para></listitem>
716
717 </itemizedlist>
718
719 </sect3>
720 </sect2>
721</sect1>
Note: See TracBrowser for help on using the repository browser.