Changeset 1d317bb for chapter07


Ignore:
Timestamp:
12/20/2004 07:09:48 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
d16b694b
Parents:
e0a04e8
Message:

Removed text in chapter 07.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4440 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Location:
chapter07
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • chapter07/bootscripts.xml

    re0a04e8 r1d317bb  
    1111
    1212<sect2 role="package"><title/>
    13 <para>The LFS-Bootscripts package contains a set of bootscripts.</para>
    1413
    1514<segmentedlist>
     
    1918</segmentedlist>
    2019
    21 <segmentedlist>
    22 <segtitle>LFS-Bootscripts installation depends on</segtitle>
    23 <seglistitem><seg>Bash, Coreutils</seg></seglistitem>
    24 </segmentedlist>
    2520</sect2>
    2621
     
    4338<sect2 id="contents-bootscripts" role="content"><title>Contents of LFS-bootscripts</title>
    4439
    45 <segmentedlist>
    46 <segtitle>Installed scripts</segtitle>
    47 <seglistitem><seg>checkfs, cleanfs, console, functions, halt, ifdown, ifup,
    48 localnet, mountfs, mountkernfs, network, rc, reboot, sendsignals, setclock, static,
    49 swap, sysklogd and template</seg></seglistitem>
    50 </segmentedlist>
    51 
    52 <variablelist><title>Short descriptions</title>
    53 
    54 <varlistentry id="checkfs-bootscripts">
    55 <term><command>checkfs</command></term>
    56 <listitem>
    57 <indexterm zone="ch-scripts-bootscripts checkfs-bootscripts"><primary sortas="d-checkfs">checkfs</primary></indexterm>
    58 <para>checks the file systems just before they are mounted (with the exception of journal
    59 and network based file systems).</para>
    60 </listitem>
    61 </varlistentry>
    62 
    63 <varlistentry id="cleanfs-bootscripts">
    64 <term><command>cleanfs</command></term>
    65 <listitem>
    66 <indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts"><primary sortas="d-cleanfs">cleanfs</primary></indexterm>
    67 <para>removes files that shouldn't be
    68 preserved between reboots, such as those in <filename class="directory">/var/run/</filename> and
    69 <filename class="directory">/var/lock/</filename>. It re-creates <filename>/var/run/utmp</filename>
    70 and removes the possibly present <filename>/etc/nologin</filename>,
    71 <filename>/fastboot</filename> and <filename>/forcefsck</filename> files.</para>
    72 </listitem>
    73 </varlistentry>
    74 
    75 <varlistentry id="console-bootscripts">
    76 <term><command>console</command></term>
    77 <listitem>
    78 <indexterm zone="ch-scripts-bootscripts console-bootscripts"><primary sortas="d-console">console</primary></indexterm>
    79 <para>loads the keymap table you specified as proper for your keyboard layout.
    80 It also sets the screen font.</para>
    81 </listitem>
    82 </varlistentry>
    83 
    84 <varlistentry id="functions-bootscripts">
    85 <term><command>functions</command></term>
    86 <listitem>
    87 <indexterm zone="ch-scripts-bootscripts functions-bootscripts"><primary sortas="d-functions">functions</primary></indexterm>
    88 <para>contains functions shared among
    89 different scripts, such as error and status checking.</para>
    90 </listitem>
    91 </varlistentry>
    92 
    93 <varlistentry id="halt-bootscripts">
    94 <term><command>halt</command></term>
    95 <listitem>
    96 <indexterm zone="ch-scripts-bootscripts halt-bootscripts"><primary sortas="d-halt">halt</primary></indexterm>
    97 <para>halts the system.</para>
    98 </listitem>
    99 </varlistentry>
    100 
    101 <varlistentry id="ifdown-bootscripts">
    102 <term><command>ifdown</command> and <command>ifup</command></term>
    103 <listitem>
    104 <indexterm zone="ch-scripts-bootscripts ifdown-bootscripts"><primary sortas="d-ifdown">ifdown</primary></indexterm>
    105 <para>assist the network script with network devices.</para>
    106 </listitem>
    107 </varlistentry>
    108 
    109 <varlistentry id="localnet-bootscripts">
    110 <term><command>localnet</command></term>
    111 <listitem>
    112 <indexterm zone="ch-scripts-bootscripts localnet-bootscripts"><primary sortas="d-localnet">localnet</primary></indexterm>
    113 <para>sets up the system's hostname and local loopback device.</para>
    114 </listitem>
    115 </varlistentry>
    116 
    117 <varlistentry id="mountfs-bootscripts">
    118 <term><command>mountfs</command></term>
    119 <listitem>
    120 <indexterm zone="ch-scripts-bootscripts mountfs-bootscripts"><primary sortas="d-mountfs">mountfs</primary></indexterm>
    121 <para>mounts all file systems that
    122 aren't marked <emphasis>noauto</emphasis> or aren't network based.</para>
    123 </listitem>
    124 </varlistentry>
    125 
    126 <varlistentry id="mountkernfs-bootscripts">
    127 <term><command>mountkernfs</command></term>
    128 <listitem>
    129 <indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts"><primary sortas="d-mountkernfs">mountkernfs</primary></indexterm>
    130 <para>is used to mount kernel-provided file systems, such as <systemitem class="filesystem">proc</systemitem>.</para>
    131 </listitem>
    132 </varlistentry>
    133 
    134 <varlistentry id="network-bootscripts">
    135 <term><command>network</command></term>
    136 <listitem>
    137 <indexterm zone="ch-scripts-bootscripts network-bootscripts"><primary sortas="d-network">network</primary></indexterm>
    138 <para>sets up network interfaces, such
    139 as network cards, and sets up the default gateway where applicable.</para>
    140 </listitem>
    141 </varlistentry>
    142 
    143 <varlistentry id="rc-bootscripts">
    144 <term><command>rc</command></term>
    145 <listitem>
    146 <indexterm zone="ch-scripts-bootscripts rc-bootscripts"><primary sortas="d-rc">rc</primary></indexterm>
    147 <para>is the master run-level control script.
    148 It is responsible for running all the other scripts one-by-one, in a sequence
    149 determined by the name of the symbolic links being processed.</para>
    150 </listitem>
    151 </varlistentry>
    152 
    153 <varlistentry id="reboot-bootscripts">
    154 <term><command>reboot</command></term>
    155 <listitem>
    156 <indexterm zone="ch-scripts-bootscripts reboot-bootscripts"><primary sortas="d-reboot">reboot</primary></indexterm>
    157 <para>reboots the system.</para>
    158 </listitem>
    159 </varlistentry>
    160 
    161 <varlistentry id="sendsignals-bootscripts">
    162 <term><command>sendsignals</command></term>
    163 <listitem>
    164 <indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts"><primary sortas="d-sendsignals">sendsignals</primary></indexterm>
    165 <para>makes sure every process is terminated before the system reboots or halts.</para>
    166 </listitem>
    167 </varlistentry>
    168 
    169 <varlistentry id="setclock-bootscripts">
    170 <term><command>setclock</command></term>
    171 <listitem>
    172 <indexterm zone="ch-scripts-bootscripts setclock-bootscripts"><primary sortas="d-setclock">setclock</primary></indexterm>
    173 <para>resets the kernel clock to
    174 localtime in case the hardware clock isn't set to GMT time.</para>
    175 </listitem>
    176 </varlistentry>
    177 
    178 <varlistentry id="static-bootscripts">
    179 <term><command>static</command></term>
    180 <listitem>
    181 <indexterm zone="ch-scripts-bootscripts static-bootscripts"><primary sortas="d-static">static</primary></indexterm>
    182 <para>provides the functionality needed
    183 to assign a static IP address to a network interface.</para>
    184 </listitem>
    185 </varlistentry>
    186 
    187 <varlistentry id="swap-bootscripts">
    188 <term><command>swap</command></term>
    189 <listitem>
    190 <indexterm zone="ch-scripts-bootscripts swap-bootscripts"><primary sortas="d-swap">swap</primary></indexterm>
    191 <para>enables and disables swap files and partitions.</para>
    192 </listitem>
    193 </varlistentry>
    194 
    195 <varlistentry id="syslogng-bootscripts">
    196 <term><command>sysklogd</command></term>
    197 <listitem>
    198 <indexterm zone="ch-scripts-bootscripts syslogng-bootscripts"><primary sortas="d-syslogng">syslog-ng</primary></indexterm>
    199 <para>starts and stops the system and kernel log daemons.</para>
    200 </listitem>
    201 </varlistentry>
    202 
    203 <varlistentry id="template-bootscripts">
    204 <term><command>template</command></term>
    205 <listitem>
    206 <indexterm zone="ch-scripts-bootscripts template-bootscripts"><primary sortas="d-template">template</primary></indexterm>
    207 <para>is a template you can use to
    208 create your own bootscripts for your other daemons.</para>
    209 </listitem>
    210 </varlistentry>
    211 </variablelist>
     40<para>See testing</para>
    21241
    21342</sect2>
  • chapter07/console.xml

    re0a04e8 r1d317bb  
    1212<secondary>configuring</secondary></indexterm>
    1313
    14 <para>In this section we will configure the <command>console</command>
    15 initscript that sets up the keyboard
    16 map and the console font. If you
    17 don't need to use any non-ASCII characters
    18 (British pound and Euro character are not ASCII),
    19 and your keyboard is a US one, you can skip this section.
    20 Without the configuration file,
    21 the <command>console</command> initscript will do nothing.</para>
    22 
    23 <para>The <command>console</command> script uses the
    24 <filename>/etc/sysconfig/console</filename>
    25 as a configuration file. You need to decide which keymap and screen font you
    26 will use. The language-specific HOWTO can help you.
    27 A pre-made
    28 <filename>/etc/sysconfig/console</filename> file with known
    29 good settings for several countries was installed with the LFS-Bootscripts
    30 package, and you just have to uncomment
    31 the relevant section if your country is supported (but read the rest
    32 of this section anyway).
    33 If still in doubt,
    34 look into <filename class="directory">/usr/share/kbd</filename>
    35 for valid keymaps and screen fonts. Then read the <command>loadkeys</command>
    36 and <command>setfont</command> manual pages and figure out the correct
    37 arguments for these programs.
    38 Once you decided, create the
    39 configuration file with the following command:</para>
    40 
    4114<screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"
    4215KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
    4316FONT="<replaceable>[arguments for setfont]</replaceable>"
    4417EOF</userinput></screen>
    45 
    46 <para>E.g., for Spanish users who also want to use the Euro character
    47 (accessible by pressing AltGr+E),
    48 the following settings are correct:</para>
    49 
    50 <screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"
    51 KEYMAP="es euro2"
    52 FONT="lat9-16 -u iso01"
    53 EOF</userinput></screen>
    54 
    55 <note><para>The FONT line above is correct only for the ISO-8859-15
    56 character set. If you prefer ISO-8859-1 and therefore use a pound sign
    57 instead of Euro, the correct FONT line is:</para>
    58 
    59 <screen><userinput>FONT="lat1-16"</userinput></screen></note>
    60 
    61 <para>If the KEYMAP or FONT variable is not set, the
    62 <command>console</command> initscript will not run the corresponding
    63 program.</para>
    64 
    65 <para>In some keymaps, the Backspace and Delete keys send characters
    66 different form ones in the default keymap built into the kernel.
    67 This confuses some applications, e.g., <application>Emacs</application>
    68 displays its help (instead of erasing the character before the cursor)
    69 when you press Backspace. To check if your keymap is affected (this works
    70 only for i386 keymaps):</para>
    71 
    72 <screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
    7318
    7419<para>If you see that keycode 14 is Backspace and not Delete,
     
    9237EOF</userinput></screen>
    9338
    94 <para>If you want to compile your keymap directly into the kernel instead of
    95 setting it every time from the <command>console</command> bootscript, then
    96 instructions are given in <xref linkend="ch-bootable-kernel"/>.  Doing this
    97 ensures that your keyboard will always work as expected, even when you boot into
    98 maintenance mode (by passing <parameter>init=/bin/sh</parameter> to the kernel),
    99 as in that situation, the <command>console</command> bootscript won't be run.
    100 Additionally, the kernel will not set the screen font automatically.  Again,
    101 this shouldn't pose too many problems as ASCII characters will still be handled
    102 correctly, and it is unlikely that you would need to rely on non-ASCII
    103 characters whilst in maintenance mode.</para>
    104 
    105 <para>Since the kernel will set up the keymap, you can omit the KEYMAP variable
    106 from the <filename>/etc/sysconfig/console</filename> configuration file. If you
    107 wish, you can still have it, this isn't going to hurt you. Keeping it could even
    108 be beneficial, in case you run a lot of different kernels and can't be sure that
    109 the keymap is compiled into every one of them.</para>
    110 
    11139</sect1>
    11240
  • chapter07/hostname.xml

    re0a04e8 r1d317bb  
    1212<secondary>configuring</secondary></indexterm>
    1313
    14 <para>Part of the localnet script is setting up the system's hostname. This
    15 needs to be configured in the <filename>/etc/sysconfig/network</filename>.</para>
    16 
    1714<para>Create the <filename>/etc/sysconfig/network</filename> file and enter a hostname by
    1815running:</para>
     
    2017<screen><userinput>echo "HOSTNAME=<replaceable>[lfs]</replaceable>" &gt; /etc/sysconfig/network</userinput></screen>
    2118
    22 <para><replaceable>[lfs]</replaceable> needs to be replaced with the name the computer is
    23 to be called. You should not enter the FQDN (Fully Qualified Domain
    24 Name) here. That information will be put in the
    25 <filename>/etc/hosts</filename> file later on.</para>
    26 
    2719</sect1>
  • chapter07/hosts.xml

    re0a04e8 r1d317bb  
    1717<primary sortas="d-network">network</primary>
    1818<secondary>/etc/hosts</secondary></indexterm>
    19 
    20 <para>If a network card is to be configured, you have to decide on the
    21 IP-address, FQDN and possible aliases for use in the <filename>/etc/hosts</filename> file. The
    22 syntax is:</para>
    23 
    24 <screen>&lt;IP address&gt; myhost.example.org aliases</screen>
    25 
    26 <para>Unless your computer is to be visible to the Internet (e.g., you have a
    27 registered domain and a valid block of assigned IP addresses - most of us don't
    28 have this) you should make sure that the IP-address is in the private network
    29 IP-address range. Valid ranges are:</para>
    30 
    31 <screen>        Class Networks
    32         A     10.0.0.0
    33         B     172.16.0.0 through 172.31.0.0
    34         C     192.168.0.0 through 192.168.255.0</screen>
    35 
    36 <para>A valid IP address could be 192.168.1.1. A valid FQDN for this IP could
    37 be www.linuxfromscratch.org (not recommended as this is a valid registered domain
    38 address and could cause your domain name server problems).</para>
    39 
    40 <para>If you aren't going to use a network card, you still need to
    41 come up with a FQDN. This is necessary for certain programs to operate
    42 correctly.</para>
    4319
    4420<para>If a network card is not going to be configured, create the
     
    6541EOF</userinput></screen>
    6642
    67 <para>Of course, the <replaceable>[192.168.1.1]</replaceable> and <replaceable>[&lt;value of HOSTNAME&gt;.example.org]</replaceable>
    68 have to be changed to your liking (or requirements if assigned an IP-address
    69 by a network/system administrator and this machine is planned to be connected
    70 to an existing network).</para>
    71 
    7243</sect1>
  • chapter07/inputrc.xml

    re0a04e8 r1d317bb  
    99
    1010<indexterm zone="ch-scripts-inputrc"><primary sortas="e-/etc/inputrc">/etc/inputrc</primary></indexterm>
    11 
    12 <para><filename>/etc/inputrc</filename> deals with the mapping of the keyboard for
    13 certain situations.  This file is the start-up file used by
    14 <application>readline</application> - the input related library used by
    15 <application>Bash</application> and most other shells.</para>
    16 
    17 <para>For more information see <command>info bash</command> -- <emphasis
    18 role="strong">Node: Readline Init</emphasis> file as well as
    19 <command>info readline</command>. There is a lot that can be done with this
    20 one rc file.</para>
    21 
    22 <para>Global values are set in <filename>/etc/inputrc</filename>.
    23 Personal user values are set in <filename>~/.inputrc</filename>. The
    24 <filename>~/.inputrc</filename> file will override the global settings
    25 file.  A later page sets up <application>Bash</application> to use
    26 <filename>/etc/inputrc</filename> if there is no
    27 <filename>.inputrc</filename> for a user when
    28 <filename>/etc/profile</filename> is read (usually at login).  If you
    29 want your system to use both, or don't want <emphasis>global</emphasis>
    30 keyboard handling, it is a good idea to place a default
    31 <filename>.inputrc</filename> into the <filename class="directory">/etc/skel</filename>
    32 directory for use with new users.</para>
    33 
    34 <para>
    35 Below is a base <filename>/etc/inputrc</filename> along with
    36 comments to explain what the various options do.  Note that comments
    37 can <emphasis>not</emphasis> be on the same line as commands.
    38 </para>
    39 
    40 <para>If you will create an <filename>.inputrc</filename> in
    41 <filename class="directory">/etc/skel</filename> using the command below, change the
    42 command's output to <filename>/etc/skel/.inputrc</filename> and be
    43 sure to check/set permissions afterward. Then you can just copy that
    44 file to <filename>/etc/inputrc</filename> and the home directory
    45 of any user already existing in the system, including root, that needs
    46 a private version of the file.  Be sure to use the <parameter>-p</parameter> parameter
    47 of <command>cp</command> to maintain permissions and be sure to change owner and group
    48 appropriately.
    49 </para>
    5011
    5112<screen><userinput>cat &gt; /etc/inputrc &lt;&lt; "EOF"
  • chapter07/introduction.xml

    re0a04e8 r1d317bb  
    88<?dbhtml filename="introduction.html"?>
    99
    10 <para>In this chapter we will install the bootscripts and set them up
    11 properly. Most of these scripts will work without needing to modify them, but
    12 a few require additional configuration files, since they deal with hardware
    13 dependent information.</para>
    14 
    15 <para>We have chosen to use System-V style init scripts simply because they
    16 are widely used and we feel comfortable with them. If you would prefer to try
    17 something else: Marc Heerdink has written a hint about BSD style init scripts,
    18 to be found at <ulink url="&hints-root;bsd-init.txt"/>. And if you'd like
    19 something more radical, search the LFS mailing lists for <quote>depinit</quote>.
    20 </para>
    21 
    22 <para>If you decide to use some other style of init scripts, you can skip this
    23 chapter and move on to <xref linkend="chapter-bootable"/>.</para>
     10<para>See testing</para>
    2411
    2512</sect1>
  • chapter07/network.xml

    re0a04e8 r1d317bb  
    1212<secondary>configuring</secondary></indexterm>
    1313
    14 <para>This section only applies if you're going to configure a network
    15 card.</para>
    16 
    17 <para>If you don't have any network cards, you are most likely not going to
    18 create any configuration files relating to network cards. If that is the
    19 case, you must remove the <filename class="symlink">network</filename> symlinks from all the
    20 run-level directories
    21 (<filename class="directory">/etc/rc.d/rc*.d</filename>)</para>
    22 
    2314<sect2>
    2415<title>Creating network interface configuration files</title>
    2516
    26 <para>Which interfaces are brought up and down by the network script depends on
    27 the files in the <filename class="directory">/etc/sysconfig/network-devices</filename> directory. This
    28 directory should contain subdirectories in the form of
    29 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is a network
    30 interface name (such as eth0)</para>
    31 
    32 <para>If you decide to rename or move this
    33 <filename class="directory">/etc/sysconfig/network-devices</filename> directory,
    34 make sure you update the <filename>/etc/sysconfig/rc</filename> file as well and
    35 update the <quote>network_devices</quote> by providing it with the new path.</para>
    36 
    37 <para>Now, new files are created in that directory.  The following command
    38 creates a sample <filename>ipv4</filename> file for the
     17<para>The following command creates a sample <filename>ipv4</filename> file for the
    3918<filename>eth0</filename> device:</para>
    4019
     
    5029EOF</userinput></screen>
    5130
    52 <para>Of course, the values of those variables have to be changed in every file
    53 to match the proper setup. If the ONBOOT variable is set to <quote>yes</quote>,
    54 the network script will bring up the equivalent interface during the booting of
    55 the system.  If set to anything but <quote>yes</quote>, the equivalent interface
    56 will be ignored by the network script and not brought up.</para>
    57 
    58 <para>The SERVICE entry defines the method of obtaining the IP address.  The LFS
    59 bootscripts have a modular IP assignment format, and by creating additional
    60 files in
    61 <filename class="directory">/etc/sysconfig/network-devices/services</filename>,
    62 you can allow other IP assignment methods.  This would commonly be used if you
    63 need DHCP, which is addressed in the BLFS book.</para>
    64 
    65 <para>Of course, GATEWAY should contain the IP of your default gateway, if you
    66 have one. If not, then don't include the GATEWAY line in the configuration
    67 file.</para>
    68 
    6931</sect2>
    7032
     
    7335<indexterm zone="resolv.conf"><primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary></indexterm>
    7436
    75 <para>If you're going to be connected to the Internet then most likely you'll
    76 need some means of DNS name resolution to resolve Internet domain names to IP
    77 addresses. This is best achieved by placing the IP address of your assigned DNS
    78 resolver, available from your ISP (Internet Service Provider) or network
    79 administrator, into <filename>/etc/resolv.conf</filename>. Create the file by
    80 running the following:</para>
     37<para>Create the file by running the following:</para>
    8138
    8239<screen><userinput>cat &gt; /etc/resolv.conf &lt;&lt; "EOF"
     
    8946EOF</userinput></screen>
    9047
    91 <para>Of course, replace
    92 <replaceable>[IP address of your nameserver]</replaceable> with the IP address
    93 of the DNS resolver assigned for your use. There will often be more than one
    94 entry (requirements demand secondary servers for fallback capability). The IP
    95 address may even be a router on your local network.</para>
    96 
    9748</sect2>
    9849
  • chapter07/profile.xml

    re0a04e8 r1d317bb  
    1010<indexterm zone="ch-scripts-profile"><primary sortas="e-/etc/profile">/etc/profile</primary></indexterm>
    1111
    12 <para>The shell program <command>/bin/bash</command> (hereafter
    13 referred to as just <quote>the shell</quote>) uses a collection of startup files to
    14 help create an environment to run in.  Each file has a specific use and
    15 may affect login and interactive environments differently.  The files in
    16 the <filename class="directory">/etc</filename> directory generally provide global
    17 settings. If an equivalent file exists in your home directory it may
    18 override the global settings.
    19 </para>
    20 
    21 <para>An interactive login shell is started after a successful login, using
    22 <command>/bin/login</command>, by reading the
    23 <filename>/etc/passwd</filename> file.  An
    24 interactive non-login shell is started at the command-line (e.g.,
    25 <prompt>[prompt]$</prompt><command>/bin/bash</command>).  A non-interactive
    26 shell is usually present when a shell script is running.  It is non-interactive
    27 because it is processing a script and not waiting for user input between
    28 commands.</para>
    29 
    30 <para>For more information see <command>info bash</command> --
    31 <emphasis role="strong">Nodes: Bash Startup Files and Interactive
    32 Shells.</emphasis></para>
    33 
    34 <para>The files <filename>/etc/profile</filename> and
    35 <filename>~/.bash_profile</filename> are read when the shell is invoked
    36 as an interactive login shell.</para>
    37 
    38 <para>A base <filename>/etc/profile</filename> created below sets some
    39 environment variables necessary for native language support. By setting them
    40 properly, you get:
    41 </para>
    42 <itemizedlist>
    43 <listitem><para>the output of programs translated into your native
    44 language;</para></listitem>
    45 <listitem><para>correct classification of characters into letters, digits and
    46 other classes - this is necessary for Bash to accept non-ASCII characters
    47 in command lines properly in non-English locales;</para></listitem>
    48 <listitem><para>the alphabetical sorting order correct for your
    49 country;</para></listitem>
    50 <listitem><para>good default paper size;</para></listitem>
    51 <listitem><para>correct formatting of monetary, time and date
    52 values.</para></listitem>
    53 </itemizedlist>
    54 
    55 <para>This script also sets the INPUTRC environment variable that makes
    56 <application>Bash</application> and <application>Readline</application> use
    57 the <filename>/etc/inputrc</filename> file we created earlier.</para>
    58 
    59 <para>Replace <replaceable>[ll]</replaceable> below with the
    60 two-letter code for your language (e.g., <quote>en</quote>) and
    61 <replaceable>[CC]</replaceable> with the two-letter code for your country
    62 (e.g., <quote>GB</quote>). Also you may need to specify
    63 (and this is actually the preferred form) your
    64 character encoding (e.g. <quote>iso8859-1</quote>) after a dot
    65 (so that the result is <quote>en_GB.iso8859-1</quote>).
    66 Issue the following command for more information:</para>
    67 
    68 <screen><userinput>man 3 setlocale</userinput></screen>
    69 
    70 <para>The list of all locales supported by Glibc can be obtained by running
    71 the following command:</para>
    72 
    73 <screen><userinput>locale -a</userinput></screen>
    74 
    75 <para>Now, when you are sure about your locale settings, create the
    76 <filename>/etc/profile</filename> file:</para>
     12<para>Create the <filename>/etc/profile</filename> file:</para>
    7713
    7814<screen><userinput>cat &gt; /etc/profile &lt;&lt; "EOF"
     
    8622EOF</userinput></screen>
    8723
    88 <note><para>The <quote>C</quote> (default) and <quote>en_US</quote>
    89 (the recommended one for US English users) locales are
    90 different.</para></note>
    91 
    92 <para>Setting the keyboard layout,
    93 the screen font and the locale-related environment variables
    94 are the only internationalization steps needed to support
    95 locales that use ordinary single-byte encodings and left-to-right
    96 writing direction. More complex cases (including UTF-8 based locales)
    97 require additional steps and additional patches because many applications
    98 tend to break in such conditions. Because of too little educational
    99 value for a typical reader, these steps and patches are not included
    100 in the LFS book and such locales are not supported by LFS in any way.
    101 </para>
    10224</sect1>
  • chapter07/setclock.xml

    re0a04e8 r1d317bb  
    1212<secondary>configuring</secondary></indexterm>
    1313
    14 <para>This <command>setclock</command> script reads the time from your hardware clock, also
    15 known as BIOS or CMOS (Complementry Metal-Oxide Semiconductor) clock, and either converts that time to localtime
    16 using the <filename>/etc/localtime</filename> file (if the hardware clock
    17 is set to GMT) or not (if the hardware clock is already set to localtime).
    18 There is no way to auto-detect whether the hardware clock is set to GMT or
    19 not, so we need to configure that here ourselves.</para>
    20 
    21 <para>Change the value of the <emphasis>UTC</emphasis> variable below to a
    22 <parameter>0</parameter> (zero) if your hardware clock is not set to GMT
    23 time.</para>
    24 
    2514<para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
    2615the following:</para>
     
    3423EOF</userinput></screen>
    3524
    36 <para>Now, you may want to take a look at a very good hint explaining how we
    37 deal with time on LFS at <ulink url="&hints-root;time.txt"/>.
    38 It explains issues such as time zones, UTC, and the TZ environment
    39 variable.</para>
    40 
    4125</sect1>
  • chapter07/usage.xml

    re0a04e8 r1d317bb  
    1212<secondary>usage</secondary></indexterm>
    1313
    14 <para>Linux uses a special booting facility named SysVinit. It's based on a
    15 concept of <emphasis>run-levels</emphasis>. It can be widely different
    16 from one system to another, so it can't be assumed that because things
    17 worked in &lt;insert distro name&gt; they should work like that in LFS
    18 too. LFS has its own way of doing things, but it respects generally
    19 accepted standards.</para>
    20 
    21 <para>SysVinit (which we'll call <emphasis>init</emphasis> from now on) works
    22 using a run-levels scheme. There are 7 (from 0 to 6) run-levels
    23 (actually, there are more run-levels but they are for special cases and
    24 generally not used. The <command>init</command> man page describes those details), and each
    25 one of those corresponds to the things the computer is supposed to do when
    26 it starts up. The default run-level is 3. Here are the descriptions of the
    27 different run-levels as they are often implemented:</para>
    28 
    29 <literallayout>0: halt the computer
    30 1: single-user mode
    31 2: multi-user mode without networking
    32 3: multi-user mode with networking
    33 4: reserved for customization, otherwise does the same as 3
    34 5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm)
    35 6: reboot the computer</literallayout>
    36 
    37 <para>The command used to change run-levels is <command>init
    38 &lt;runlevel&gt;</command> where &lt;runlevel&gt; is the target run-level. For
    39 example, to reboot the computer, a user would issue the <userinput>init
    40 6</userinput> command. The <command>reboot</command> command is just an alias for
    41 it, as is the <command>halt</command> command an alias for <command>init
    42 0</command>.</para>
    43 
    44 <para>There are a number of directories under <filename class="directory">/etc/rc.d</filename>
    45 that look like like <filename class="directory">rc?.d</filename> (where ? is the
    46 number of the run-level) and <filename class="directory">rcsysinit.d</filename>
    47 all containing a number of symbolic links. Some begin with a K, the others begin
    48 with an S, and all of them have two numbers following the initial letter. The K
    49 means to stop (kill) a service, and the S means to start a service. The numbers
    50 determine the order in which the scripts are run, from 00 to 99; the lower the
    51 number the sooner it gets executed. When init switches to another run-level, the
    52 appropriate services get killed and others get started.</para>
    53 
    54 <para>The real scripts are in <filename class="directory">/etc/rc.d/init.d</filename>.
    55 They do all the work, and the symlinks all point to them. Killing links and starting links
    56 point to the same script in <filename class="directory">/etc/rc.d/init.d</filename>.
    57 That's because the scripts can be called with different parameters like
    58 <parameter>start</parameter>, <parameter>stop</parameter>,
    59 <parameter>restart</parameter>, <parameter>reload</parameter>,
    60 <parameter>status</parameter>. When a K link is encountered, the appropriate
    61 script is run with the <parameter>stop</parameter> argument. When an S link is
    62 encountered, the appropriate script is run with the <parameter>start</parameter>
    63 argument.</para>
    64 
    65 <para>There is one exception. Links that start with an S in the
    66 rc0.d and rc6.d directories will not cause anything to be started. They
    67 will be called with the parameter <parameter>stop</parameter> to stop
    68 something. The logic behind it is that when you are going to reboot or
    69 halt the system, you don't want to start anything, only stop the
    70 system.</para>
    71 
    72 <para>These are descriptions of what the arguments make the
    73 scripts do:</para>
    74 
    75 <variablelist>
    76 <varlistentry>
    77 <term><parameter>start</parameter></term>
    78 <listitem><para>The service is started.</para></listitem>
    79 </varlistentry>
    80 
    81 <varlistentry>
    82 <term><parameter>stop</parameter></term>
    83 <listitem><para>The service is stopped.</para></listitem>
    84 </varlistentry>
    85 
    86 <varlistentry>
    87 <term><parameter>restart</parameter></term>
    88 <listitem><para>The service is stopped and then started again.</para></listitem>
    89 </varlistentry>
    90 
    91 <varlistentry>
    92 <term><parameter>reload</parameter></term>
    93 <listitem><para>The configuration of the service is updated.
    94 This is used after the configuration file of a service was modified, when
    95 the service doesn't need to be restarted.</para></listitem>
    96 </varlistentry>
    97 
    98 <varlistentry>
    99 <term><parameter>status</parameter></term>
    100 <listitem><para>Tells if the service is running and with which PIDs.</para></listitem>
    101 </varlistentry>
    102 </variablelist>
    103 
    104 <para>Feel free to modify the way the boot process works (after all, it's your
    105 own LFS system). The files given here are just an example of how it can be
    106 done in a nice way (well, what we consider nice -- you may hate it).</para>
     14<para>See testing</para>
    10715
    10816</sect1>
Note: See TracChangeset for help on using the changeset viewer.