source: chapter09/usage.xml@ ee950a5e

12.1 12.1-rc1 multilib trunk xry111/arm64 xry111/clfs-ng xry111/loongarch xry111/loongarch-12.1 xry111/mips64el xry111/update-glibc
Last change on this file since ee950a5e was ee950a5e, checked in by Xi Ruoyao <xry111@…>, 5 months ago

More <quote> clean up

Use <quote> instead of '"' if possible. Use <literal>,
<computeroutput>, etc. instead of <quote> if possible. Replace
<quote>alpha</quote> with a UTF-8 Greek alpha character.

BTW decorate ".link" with <filename class='extension'>.

  • Property mode set to 100644
File size: 29.5 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
436 <listitem>
437 <para>For a non-Unicode setup, only the KEYMAP and FONT variables are
438 generally needed. E.g., for a Polish setup, one would use:</para>
439<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
440<literal># Begin /etc/sysconfig/console
441
442KEYMAP="pl2"
443FONT="lat2a-16 -m 8859-2"
444
445# End /etc/sysconfig/console</literal>
446EOF</userinput></screen>
447 </listitem>
448
449 <listitem>
450 <para>As mentioned above, it is sometimes necessary to adjust a
451 stock keymap slightly. The following example adds the Euro symbol to the
452 German keymap:</para>
453
454<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
455<literal># Begin /etc/sysconfig/console
456
457KEYMAP="de-latin1"
458KEYMAP_CORRECTIONS="euro2"
459FONT="lat0-16 -m 8859-15"
460UNICODE="1"
461
462# End /etc/sysconfig/console</literal>
463EOF</userinput></screen>
464 </listitem>
465
466 <listitem>
467 <para>The following is a Unicode-enabled example for Bulgarian, where a
468 stock UTF-8 keymap exists:</para>
469<!-- This is what is used by jhalfs for creating the console file: whenever
470 you change the following, please inform the jhalfs maintainer(s). -->
471<screen><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
472<literal># Begin /etc/sysconfig/console
473
474UNICODE="1"
475KEYMAP="bg_bds-utf8"
476FONT="LatArCyrHeb-16"
477
478# End /etc/sysconfig/console</literal>
479EOF</userinput></screen>
480 </listitem>
481
482 <listitem>
483 <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous
484 example, bright colors are no longer available on the Linux console unless
485 a framebuffer is used. If one wants to have bright colors without a
486 framebuffer and can live without characters not belonging to his language,
487 it is still possible to use a language-specific 256-glyph font, as
488 illustrated below:</para>
489
490<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
491<literal># Begin /etc/sysconfig/console
492
493UNICODE="1"
494KEYMAP="bg_bds-utf8"
495FONT="cyr-sun16"
496
497# End /etc/sysconfig/console</literal>
498EOF</userinput></screen>
499 </listitem>
500
501 <listitem>
502 <para>The following example illustrates keymap autoconversion from
503 ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:</para>
504
505<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
506<literal># Begin /etc/sysconfig/console
507
508UNICODE="1"
509KEYMAP="de-latin1"
510KEYMAP_CORRECTIONS="euro2"
511LEGACY_CHARSET="iso-8859-15"
512FONT="LatArCyrHeb-16 -m 8859-15"
513
514# End /etc/sysconfig/console</literal>
515EOF</userinput></screen>
516 </listitem>
517
518 <listitem>
519 <para>Some keymaps have dead keys (i.e., keys that don't produce a
520 character by themselves, but put an accent on the character produced
521 by the next key) or define composition rules (such as: <quote>press
522 Ctrl+. A E to get &AElig;</quote> in the default keymap).
523 Linux-&linux-version; interprets dead keys and composition rules in the
524 keymap correctly only when the source characters to be composed together
525 are not multibyte. This deficiency doesn't affect keymaps for European
526 languages, because there accents are added to unaccented ASCII
527 characters, or two ASCII characters are composed together. However, in
528 UTF-8 mode it is a problem; e.g., for the Greek language, where one
529 sometimes needs to put an accent on the letter α.
530 The solution is either to avoid the use of UTF-8, or to install the
531 X window system, which doesn't have this limitation, in its input
532 handling.</para>
533 </listitem>
534
535 <listitem>
536 <para>For Chinese, Japanese, Korean, and some other languages, the Linux
537 console cannot be configured to display the needed characters. Users
538 who need such languages should install the X Window System, fonts that
539 cover the necessary character ranges, and the proper input method (e.g.,
540 SCIM supports a wide variety of languages).</para>
541 </listitem>
542
543 </itemizedlist>
544
545 <!-- Added because folks keep posting their console file with X questions
546 to blfs-support list -->
547 <note>
548 <para>The <filename>/etc/sysconfig/console</filename> file only controls
549 the Linux text console localization. It has nothing to do with setting
550 the proper keyboard layout and terminal fonts in the X Window System, with
551 ssh sessions, or with a serial console. In such situations, limitations
552 mentioned in the last two list items above do not apply.</para>
553 </note>
554
555 </sect2>
556
557 <sect2 id="ch-config-createfiles">
558 <title>Creating Files at Boot</title>
559
560 <indexterm zone="ch-config-createfiles">
561 <primary sortas="d-createfiles">File creation at boot</primary>
562 <secondary>configuring</secondary>
563 </indexterm>
564
565 <para>At times, it is desirable to create files at boot time. For instance,
566 the <filename class="directory">/tmp/.ICE-unix</filename> directory
567 is often needed. This can be done by creating an entry in the
568 <filename>/etc/sysconfig/createfiles</filename> configuration script.
569 The format of this file is embedded in the comments of the default
570 configuration file.</para>
571 </sect2>
572
573 <sect2 id="ch-config-sysklogd">
574 <title>Configuring the Sysklogd Script</title>
575
576 <indexterm zone="ch-config-sysklogd">
577 <primary sortas="d-sysklogd">sysklogd</primary>
578 <secondary>configuring</secondary>
579 </indexterm>
580
581 <para>The <filename>sysklogd</filename> script invokes the
582 <command>syslogd</command> program as a part of System V initialization. The
583 <parameter>-m 0</parameter> option turns off the periodic timestamp mark that
584 <command>syslogd</command> writes to the log files every 20 minutes by
585 default. If you want to turn on this periodic timestamp mark, edit
586 <filename>/etc/sysconfig/rc.site</filename> and define the variable
587 SYSKLOGD_PARMS to the desired value. For instance, to remove all parameters,
588 set the variable to a null value:</para>
589
590<screen role="nodump">SYSKLOGD_PARMS=</screen>
591
592 <para>See <userinput>man syslogd</userinput> for more options.</para>
593
594 </sect2>
595
596 <sect2 id="ch-config-site">
597 <title>The rc.site File</title>
598
599 <indexterm zone="ch-config-site">
600 <primary sortas="a-rc.site">rc.site</primary>
601 </indexterm>
602
603 <para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains
604 settings that are automatically set for each SystemV boot script. It can
605 alternatively set the values specified in the <filename>hostname</filename>,
606 <filename>console</filename>, and <filename>clock</filename> files in the
607 <filename class='directory'>/etc/sysconfig/</filename> directory. If the
608 associated variables are present in both these separate files and
609 <filename>rc.site</filename>, the values in the script-specific files take
610 effect. </para>
611
612 <para><filename>rc.site</filename> also contains parameters that can
613 customize other aspects of the boot process. Setting the IPROMPT variable
614 will enable selective running of bootscripts. Other options are described
615 in the file comments. The default version of the file is as follows:</para>
616
617 <!-- Use role to fix a pdf generation problem -->
618 <screen role="auto">&site;</screen>
619
620 <sect3>
621 <title>Customizing the Boot and Shutdown Scripts</title>
622
623 <para>The LFS boot scripts boot and shut down a system in a fairly
624 efficient manner, but there are a few tweaks you can make in the
625 rc.site file to improve speed even more, and to adjust messages according
626 to your preferences. To do this, adjust the settings in
627 the <filename>/etc/sysconfig/rc.site</filename> file above.</para>
628
629 <itemizedlist>
630
631 <listitem><para>During the boot script <filename>udev</filename>, there is
632 a call to <command>udev settle</command> that requires some time to
633 complete. This time may or may not be required depending on the devices
634 in the system. If you only have simple partitions and a single ethernet
635 card, the boot process will probably not need to wait for this command. To
636 skip it, set the variable OMIT_UDEV_SETTLE=y.</para></listitem>
637
638 <listitem><para>The boot script <filename>udev_retry</filename> also runs
639 <command>udev settle</command> by default. This command is only needed
640 if the <filename class='directory'>/var</filename> directory is
641 separately mounted, because the clock needs the
642 <filename>/var/lib/hwclock/adjtime</filename> file. Other customizations may
643 also need to wait for udev to complete, but in many installations it is not
644 necessary. Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y.
645 </para></listitem>
646
647 <listitem><para>By default, the file system checks are silent. This can
648 appear to be a delay during the bootup process. To turn on the
649 <command>fsck</command> output, set the variable VERBOSE_FSCK=y.
650 </para></listitem>
651
652 <listitem><para>When rebooting, you may want to skip the filesystem check,
653 <command>fsck</command>, completely. To do this, either create the file
654 <filename>/fastboot</filename> or reboot the system with the command
655 <command>/sbin/shutdown -f -r now</command>. On the other hand, you can
656 force all file systems to be checked by creating
657 <filename>/forcefsck</filename> or running <command>shutdown</command> with
658 the <parameter>-F</parameter> parameter instead of <parameter>-f</parameter>.
659 </para>
660
661 <para>Setting the variable FASTBOOT=y will disable <command>fsck</command>
662 during the boot process until it is removed. This is not recommended
663 on a permanent basis.</para></listitem>
664
665 <listitem><para>Normally, all files in the <filename
666 class='directory'>/tmp</filename> directory are deleted at boot time.
667 Depending on the number of files or directories present, this can cause a
668 noticeable delay in the boot process. To skip removing these files set the
669 variable SKIPTMPCLEAN=y.</para></listitem>
670
671 <listitem><para>During shutdown, the <command>init</command> program sends
672 a TERM signal to each program it has started (e.g. agetty), waits for a set
673 time (default 3 seconds), then sends each process a KILL signal and waits
674 again. This process is repeated in the <command>sendsignals</command>
675 script for any processes that are not shut down by their own scripts. The
676 delay for <command>init</command> can be set by passing a parameter. For
677 example to remove the delay in <command>init</command>, pass the -t0
678 parameter when shutting down or rebooting (e.g. <command>/sbin/shutdown
679 -t0 -r now</command>). The delay for the <command>sendsignals</command>
680 script can be skipped by setting the parameter
681 KILLDELAY=0.</para></listitem>
682
683 </itemizedlist>
684
685 </sect3>
686 </sect2>
687</sect1>
Note: See TracBrowser for help on using the repository browser.