source: chapter09/usage.xml@ fdd0273

arm
Last change on this file since fdd0273 was 6c0ac5a, checked in by William Harrington <kb0iic@…>, 2 years ago

[Sysv]: /etc/inittab: respawn sulogin in runlevel 1

If run once (as it is now), the only possibility after hitting
control-D is to reboot. Note that init treats the S runlevel
differently:
when the last daemon to be run n runlevel S exits, init switches
to the default runlevel. This is not the case for other runlevels.

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