source: chapter09/usage.xml@ dfb8516

11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 bdubbs/gcc13 multilib renodr/libudev-from-systemd trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/update-glibc
Last change on this file since dfb8516 was dfb8516, checked in by David Bryant <david@…>, 16 months ago

Minor tweaks: a couple of commas, "your time zone".

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