Changeset 06df566


Ignore:
Timestamp:
12/30/2022 06:57:01 PM (16 months ago)
Author:
David Bryant <david@…>
Branches:
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
Children:
3a020ac, dfb8516
Parents:
e193e357
Message:

Removed superfluities, corrected spelling and capitalization.

Clarifed things that seemed unclear. Removed some phrases that
said little. Broke up a run-on sentence. Etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter09/usage.xml

    re193e357 r06df566  
    2020    <title>How Do the System V Bootscripts Work?</title>
    2121
    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>
     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>
    2731
    2832    <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 in LFS:</para>
     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>
    3539
    3640<literallayout>0: halt the computer
    37411: single-user mode
    38 2: reserved for customization, otherwise does the same as 3
     422: reserved for customization, otherwise the same as 3
    39433: multi-user mode with networking
    40 4: reserved for customization, otherwise does the same as 3
     444: reserved for customization, otherwise the same as 3
    41455: same as 4, it is usually used for GUI login (like GNOME's <command>gdm</command> or LXDE's <command>lxdm</command>)
    42466: reboot the computer</literallayout>
     
    4650          Classically, run level 2 above was defined as
    4751          "multi-user mode without networking", but this was only the case
    48           many years ago when multiple users could log into a system connected via
    49           serial ports.  In today's environment it makes no sense and
    50           we designate it now as "reserved".
     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".
    5155       </para>
    5256    </note>
     
    6670  </indexterm>
    6771
    68   <para>During the kernel initialization, the first program that is run
    69   is either specified on the command line or, by default
     72  <para>During kernel initialization, the first program that is run
     73  (if not overridden on the command line) is
    7074  <command>init</command>.  This program reads the initialization file
    7175  <filename>/etc/inittab</filename>.  Create this file with:</para>
     
    102106
    103107  <para>An explanation of this initialization file is in the man page for
    104   <emphasis>inittab</emphasis>.  For LFS, the key command that is run is
    105   <command>rc</command>. The initialization file above will instruct
     108  <emphasis>inittab</emphasis>.  In LFS, the key command is
     109  <command>rc</command>. The initialization file above instructs
    106110  <command>rc</command> to run all the scripts starting with an S in the
    107111  <filename class="directory">/etc/rc.d/rcS.d</filename> directory
     
    114118  This library also reads an optional configuration file,
    115119  <filename>/etc/sysconfig/rc.site</filename>.  Any of the system
    116   configuration file parameters described in subsequent sections can be
    117   alternatively placed in this file allowing consolidation of all system
     120  configuration parameters described in subsequent sections can be
     121  placed in this file, allowing consolidation of all system
    118122  parameters in this one file.</para>
    119123
     
    121125  to <filename>/run/var/bootlog</filename>.  Since the <filename
    122126  class="directory">/run</filename> directory is a tmpfs, this file is not
    123   persistent across boots, however it is appended to the more permanent file
     127  persistent across boots; however, it is appended to the more permanent file
    124128  <filename>/var/log/boot.log</filename> at the end of the boot process.</para>
    125129
     
    127131  <title>Changing Run Levels</title>
    128132
    129   <para>Changing run-levels is done with <command>init
     133  <para>Changing run levels is done with <command>init
    130134  <replaceable>&lt;runlevel&gt;</replaceable></command>, where
    131   <replaceable>&lt;runlevel&gt;</replaceable> is the target run-level. For example, to
     135  <replaceable>&lt;runlevel&gt;</replaceable> is the target run level. For example, to
    132136  reboot the computer, a user could issue the <command>init 6</command> command,
    133137  which is an alias for the <command>reboot</command> command. Likewise,
     
    137141  <para>There are a number of directories under <filename
    138142  class="directory">/etc/rc.d</filename> that look like <filename
    139   class="directory">rc?.d</filename> (where ? is the number of the run-level) and
     143  class="directory">rc?.d</filename> (where ? is the number of the run level) and
    140144  <filename class="directory">rcS.d</filename>, all containing a number of
    141   symbolic links. Some begin with a <emphasis>K</emphasis>, the others begin with
     145  symbolic links. Some links begin with a <emphasis>K</emphasis>; the others begin with
    142146  an <emphasis>S</emphasis>, and all of them have two numbers following the
    143147  initial letter. The K means to stop (kill) a service and the S means to start a
    144148  service. The numbers determine the order in which the scripts are run, from 00
    145   to 99&mdash;the lower the number the earlier it gets executed. When
    146   <command>init</command> switches to another run-level, the appropriate services
    147   are either started or stopped, depending on the runlevel chosen.</para>
     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>
    148152
    149153  <para>The real scripts are in <filename
     
    228232      <para>The <filename>/etc/rc.d/init.d/udev</filename> initscript starts
    229233      <command>udevd</command>, triggers any "coldplug" devices that have
    230       already been created by the kernel and waits for any rules to complete.
     234      already been created by the kernel, and waits for any rules to complete.
    231235      The script also unsets the uevent handler from the default of
    232236      <filename>/sbin/hotplug </filename>.  This is done because the kernel no
    233       longer needs to call out to an external binary.  Instead
     237      longer needs to call an external binary.  Instead,
    234238      <command>udevd</command> will listen on a netlink socket for uevents that
    235239      the kernel raises.</para>
    236240
    237       <para>The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes
     241      <para>The <command>/etc/rc.d/init.d/udev_retry</command> script takes
    238242      care of re-triggering events for subsystems whose rules may rely on
    239       filesystems that are not mounted until the <command>mountfs</command>
     243      file systems that are not mounted until the <command>mountfs</command>
    240244      script is run (in particular, <filename class="directory">/usr</filename>
    241245      and <filename class="directory">/var</filename> may cause this).  This
    242246      script runs after the <command>mountfs</command> script, so those rules
    243247      (if re-triggered) should succeed the second time around.  It is
    244       configured from the <filename>/etc/sysconfig/udev_retry</filename> file;
     248      configured by the <filename>/etc/sysconfig/udev_retry</filename> file;
    245249      any words in this file other than comments are considered subsystem names
    246250      to trigger at retry time.  To find the subsystem of a device, use
     
    261265
    262266    <para>The <command>setclock</command> script reads the time from the hardware
    263     clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
     267    clock, also known as the BIOS or Complementary Metal Oxide Semiconductor
    264268    (CMOS) clock. If the hardware clock is set to UTC, this script will convert the
    265269    hardware clock's time to the local time using the
    266270    <filename>/etc/localtime</filename> file (which tells the
    267     <command>hwclock</command> program which timezone to use). There is no
     271    <command>hwclock</command> program which time zone to use). There is no
    268272    way to detect whether or not the hardware clock is set to UTC, so this
    269     needs to be configured manually.</para>
     273    must be configured manually.</para>
    270274
    271275    <para>The <command>setclock</command> program is run via
     
    280284    set to local time. If the output from <command>hwclock</command> is not local
    281285    time, chances are it is set to UTC time. Verify this by adding or subtracting
    282     the proper amount of hours for the timezone to the time shown by
     286    the proper number of hours for the time zone to the time shown by
    283287    <command>hwclock</command>. For example, if you are currently in the MST
    284     timezone, which is also known as GMT -0700, add seven hours to the local
     288    time zone, which is also known as GMT -0700, add seven hours to the local
    285289    time.</para>
    286290
     
    326330  bootscript that sets up the keyboard map, console font, and console kernel log
    327331  level. If non-ASCII characters (e.g., the copyright sign, the British pound
    328   sign and Euro symbol) will not be used and the keyboard is a U.S. one, much
     332  sign, and the Euro symbol) will not be used and the keyboard is a U.S. one, much
    329333  of this section can be skipped. Without the configuration file, (or
    330334  equivalent settings in <filename>rc.site</filename>), the
     
    334338  <filename>/etc/sysconfig/console</filename> file for configuration
    335339  information.  Decide which keymap and screen font will be used. Various
    336   language-specific HOWTOs can also help with this, see <ulink
     340  language-specific HOWTOs can also help with this; see <ulink
    337341  url="https://tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in
    338342  doubt, look in the <filename class="directory">/usr/share/keymaps</filename>
    339343  and <filename class="directory">/usr/share/consolefonts</filename> directories
    340   for valid keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
     344  for valid keymaps and screen fonts. Read the <filename>loadkeys(1)</filename> and
    341345  <filename>setfont(8)</filename> manual pages to determine the correct
    342346  arguments for these programs.</para>
     
    359363      <listitem>
    360364        <para>This variable specifies the arguments for the
    361         <command>loadkeys</command> program, typically, the name of keymap
     365        <command>loadkeys</command> program, typically, the name of the keymap
    362366        to load, e.g., <quote>it</quote>. If this variable is not set, the
    363367        bootscript will not run the <command>loadkeys</command> program,
     
    391395        map to load. E.g., in order to load the <quote>lat1-16</quote> font
    392396        together with the <quote>8859-1</quote> application character map
    393         (as it is appropriate in the USA),
     397        (appropriate in the USA),
    394398        <!-- because of the copyright sign -->
    395399        set this variable to <quote>lat1-16 -m 8859-1</quote>.
    396         In UTF-8 mode, the kernel uses the application character map for
    397         conversion of composed 8-bit key codes in the keymap to UTF-8, and thus
     400        In UTF-8 mode, the kernel uses the application character map to
     401        convert 8-bit key codes to UTF-8. Therefore
    398402        the argument of the "-m" parameter should be set to the encoding of the
    399403        composed key codes in the keymap.</para>
     
    405409      <term>UNICODE</term>
    406410      <listitem>
    407         <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or
     411        <para>Set this variable to <quote>1</quote>, <quote>yes</quote>, or
    408412        <quote>true</quote> in order to put the
    409413        console into UTF-8 mode. This is useful in UTF-8 based locales and
     
    523527      sometimes needs to put an accent on the letter <quote>alpha</quote>.
    524528      The solution is either to avoid the use of UTF-8, or to install the
    525       X window system that doesn't have this limitation in its input
     529      X window system, which doesn't have this limitation, in its input
    526530      handling.</para>
    527531    </listitem>
     
    532536      who need such languages should install the X Window System, fonts that
    533537      cover the necessary character ranges, and the proper input method (e.g.,
    534       SCIM, supports a wide variety of languages).</para>
     538      SCIM supports a wide variety of languages).</para>
    535539    </listitem>
    536540
     
    566570
    567571  <sect2 id="ch-config-sysklogd">
    568     <title>Configuring the sysklogd Script</title>
     572    <title>Configuring the Sysklogd Script</title>
    569573
    570574    <indexterm zone="ch-config-sysklogd">
     
    601605    <filename class='directory'>/etc/sysconfig/</filename> directory.  If the
    602606    associated variables are present in both these separate files and
    603     <filename>rc.site</filename>, the values in the script specific files have
    604     precedence. </para>
     607    <filename>rc.site</filename>, the values in the script-specific files take
     608    effect. </para>
    605609
    606610    <para><filename>rc.site</filename> also contains parameters that can
     
    616620
    617621      <para>The LFS boot scripts boot and shut down a system in a fairly
    618       efficient manner, but there are a few tweaks that you can make in the
    619       rc.site file to improve speed even more and to adjust messages according
     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
    620624      to your preferences. To do this, adjust the settings in
    621625      the <filename>/etc/sysconfig/rc.site</filename> file above.</para>
     
    625629      <listitem><para>During the boot script <filename>udev</filename>, there is
    626630      a call to <command>udev settle</command> that requires some time to
    627       complete. This time may or may not be required depending on devices present
     631      complete. This time may or may not be required depending on the devices
    628632      in the system.  If you only have simple partitions and a single ethernet
    629633      card, the boot process will probably not need to wait for this command.  To
     
    631635
    632636      <listitem><para>The boot script <filename>udev_retry</filename> also runs
    633       <command>udev settle</command> by default.  This command is only needed by
    634       default if the <filename class='directory'>/var</filename> directory is
    635       separately mounted.  This is because the clock needs the file
    636       <filename>/var/lib/hwclock/adjtime</filename>.  Other customizations may
     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
    637641      also need to wait for udev to complete, but in many installations it is not
    638       needed.  Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y.
     642      necessary.  Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y.
    639643      </para></listitem>
    640644
     
    665669      <listitem><para>During shutdown, the <command>init</command> program sends
    666670      a TERM signal to each program it has started (e.g. agetty), waits for a set
    667       time (default 3 seconds), and sends each process a KILL signal and waits
     671      time (default 3 seconds), then sends each process a KILL signal and waits
    668672      again.  This process is repeated in the <command>sendsignals</command>
    669673      script for any processes that are not shut down by their own scripts.  The
Note: See TracChangeset for help on using the changeset viewer.