diff options
Diffstat (limited to 'chapter07')
-rw-r--r-- | chapter07/bootscripts.xml | 120 | ||||
-rw-r--r-- | chapter07/chapter07.xml | 53 | ||||
-rw-r--r-- | chapter07/hostname.xml | 12 | ||||
-rw-r--r-- | chapter07/hosts.xml | 22 | ||||
-rw-r--r-- | chapter07/introduction.xml | 25 | ||||
-rw-r--r-- | chapter07/loadkeys.xml | 29 | ||||
-rw-r--r-- | chapter07/network.xml | 42 | ||||
-rw-r--r-- | chapter07/setclock.xml | 16 | ||||
-rw-r--r-- | chapter07/sysklogd.xml | 12 | ||||
-rw-r--r-- | chapter07/usage.xml | 34 |
10 files changed, 275 insertions, 90 deletions
diff --git a/chapter07/bootscripts.xml b/chapter07/bootscripts.xml index dc90e2e68..9ee79f203 100644 --- a/chapter07/bootscripts.xml +++ b/chapter07/bootscripts.xml @@ -1,33 +1,121 @@ -<sect1 id="ch-system-lfs-bootscripts" xreflabel="Bootscripts"> -<title>Installing LFS-Bootscripts-&bootscripts-version;</title> -<?dbhtml filename="bootscripts.html" dir="chapter07"?> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> +<sect1 id="ch-scripts-bootscripts" xreflabel="Bootscripts"> +<title>LFS-Bootscripts-&bootscripts-version;</title> +<?dbhtml filename="bootscripts.html"?> + +<indexterm zone="ch-scripts-bootscripts"><primary sortas="a-Bootscripts">Bootscripts</primary></indexterm> <para>The LFS-Bootscripts package contains a set of bootscripts.</para> -<screen>&buildtime; &bootscripts-time; -&diskspace; &bootscripts-compsize;</screen> +<screen>&buildtime; 0.1 SBU +&diskspace; 0.3 MB</screen> + +<para>LFS-Bootscripts installation depends on: Bash, Coreutils.</para> -&bootscripts-down; -&bootscripts-dep; -<sect2><title> </title><para> </para></sect2> <sect2> <title>Installation of LFS-Bootscripts</title> -<para>Install the boot scripts simply by copying them to their -destination:</para> +<para>Installation of the bootscripts is very simple:</para> + +<screen><userinput>make install</userinput></screen> + +</sect2> -<screen><userinput>cp -a rc.d sysconfig /etc</userinput></screen> -<para>Make sure <emphasis>root</emphasis> is owner of the scripts:</para> +<sect2 id="contents-bootscripts"><title>Contents of LFS-bootscripts</title> -<screen><userinput>chown -R root:root /etc/rc.d /etc/sysconfig</userinput></screen> +<para><emphasis>Installed scripts</emphasis>: checkfs, cleanfs, functions, +halt, ifdown, ifup, loadkeys, localnet, mountfs, mountkernfs, network, rc, +reboot, sendsignals, setclock, static, swap, sysklogd and template</para> </sect2> -&bootscripts-shortdesc; -&bootscripts-desc; -</sect1> +<sect2><title>Short descriptions</title> + +<indexterm zone="ch-scripts-bootscripts checkfs-bootscripts"><primary sortas="d-checkfs">checkfs</primary></indexterm> +<para id="checkfs-bootscripts">The <command>checkfs</command> script checks the file systems just +before they are mounted (with the exception of journal and network based +file systems).</para> + +<indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts"><primary sortas="d-cleanfs">cleanfs</primary></indexterm> +<para id="cleanfs-bootscripts">The <command>cleanfs</command> script removes files that shouldn't be +preserved between reboots, such as those in <filename>/var/run/</filename> and +<filename>/var/lock/</filename>. It re-creates <filename>/var/run/utmp</filename> +and removes the possibly present <filename>/etc/nologin</filename>, +<filename>/fastboot</filename> and <filename>/forcefsck</filename> files.</para> + +<indexterm zone="ch-scripts-bootscripts functions-bootscripts"><primary sortas="d-functions">functions</primary></indexterm> +<para id="functions-bootscripts">The <command>functions</command> script contains functions shared among +different scripts, such as error and status checking.</para> + +<indexterm zone="ch-scripts-bootscripts halt-bootscripts"><primary sortas="d-halt">halt</primary></indexterm> +<para id="halt-bootscripts">The <command>halt</command> script halts the system.</para> + +<indexterm zone="ch-scripts-bootscripts ifdown-bootscripts"><primary sortas="d-ifdown">ifdown</primary></indexterm> +<para id="ifdown-bootscripts">The <command>ifdown</command> and <command>ifup</command> scripts assist +the network script with network devices.</para> + +<indexterm zone="ch-scripts-bootscripts loadkeys-bootscripts"><primary sortas="d-loadkeys">loadkeys</primary></indexterm> +<para id="loadkeys-bootscripts">The <command>loadkeys</command> script loads the keymap table you +specified as proper for your keyboard layout.</para> + +<indexterm zone="ch-scripts-bootscripts localnet-bootscripts"><primary sortas="d-localnet">localnet</primary></indexterm> +<para id="localnet-bootscripts">The <command>localnet</command> script sets up the system's hostname and +local loopback device.</para> + +<indexterm zone="ch-scripts-bootscripts mountfs-bootscripts"><primary sortas="d-mountfs">mountfs</primary></indexterm> +<para id="mountfs-bootscripts">The <command>mountfs</command> script mounts all file systems that +aren't marked <emphasis>noauto</emphasis> or aren't network based.</para> + +<indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts"><primary sortas="d-mountkernfs">mountkernfs</primary></indexterm> +<para id="mountkernfs-bootscripts">The <command>mountkernfs</command> script is used to mount +kernel-provided file systems, such as /proc.</para> +<indexterm zone="ch-scripts-bootscripts network-bootscripts"><primary sortas="d-network">network</primary></indexterm> +<para id="network-bootscripts">The <command>network</command> script sets up network interfaces, such +as network cards, and sets up the default gateway where applicable.</para> + +<indexterm zone="ch-scripts-bootscripts rc-bootscripts"><primary sortas="d-rc">rc</primary></indexterm> +<para id="rc-bootscripts">The <command>rc</command> script is the master run-level control script. +It is responsible for running all the other scripts one-by-one, in a sequence +determined by the name of the symbolic links being processed.</para> + +<indexterm zone="ch-scripts-bootscripts reboot-bootscripts"><primary sortas="d-reboot">reboot</primary></indexterm> +<para id="reboot-bootscripts">The <command>reboot</command> script reboots the system.</para> + +<indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts"><primary sortas="d-sendsignals">sendsignals</primary></indexterm> +<para id="sendsignals-bootscripts">The <command>sendsignals</command> script makes sure every process is +terminated before the system reboots or halts.</para> + +<indexterm zone="ch-scripts-bootscripts setclock-bootscripts"><primary sortas="d-setclock">setclock</primary></indexterm> +<para id="setclock-bootscripts">The <command>setclock</command> script resets the kernel clock to +localtime in case the hardware clock isn't set to GMT time.</para> + +<indexterm zone="ch-scripts-bootscripts static-bootscripts"><primary sortas="d-static">static</primary></indexterm> +<para id="static-bootscripts">The <command>static</command> script provides the functionality needed +to assign a static IP address to a network interface.</para> + +<indexterm zone="ch-scripts-bootscripts swap-bootscripts"><primary sortas="d-swap">swap</primary></indexterm> +<para id="swap-bootscripts">The <command>swap</command> script enables and disables swap files and +partitions.</para> + +<indexterm zone="ch-scripts-bootscripts sysklogd-bootscripts"><primary sortas="d-sysklogd">sysklogd</primary></indexterm> +<para id="sysklogd-bootscripts">The <command>sysklogd</command> script starts and stops the system and +kernel log daemons.</para> + +<indexterm zone="ch-scripts-bootscripts template-bootscripts"><primary sortas="d-template">template</primary></indexterm> +<para id="template-bootscripts">The <command>template</command> script is a template you can use to +create your own bootscripts for your other daemons.</para> + +</sect2> + + + +</sect1> diff --git a/chapter07/chapter07.xml b/chapter07/chapter07.xml index 9dc8bc3ac..6482e26a8 100644 --- a/chapter07/chapter07.xml +++ b/chapter07/chapter07.xml @@ -1,37 +1,40 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> <chapter id="chapter-bootscripts" xreflabel="Chapter 7"> +<?dbhtml dir="chapter07"?> <title>Setting up system boot scripts</title> -<?dbhtml filename="chapter07.html" dir="chapter07"?> +<?dbhtml filename="chapter07.html"?> -<sect1 id="ch-scripts-introduction"> -<title>Introduction</title> -<?dbhtml filename="introduction.html" dir="chapter07"?> +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/> -<para>In this chapter we will install the bootscripts and set them up -properly. Most of these scripts will work without needing to modify them, but -a few require additional configuration files, since they deal with hardware -dependent information.</para> -<para>We have chosen to use System-V style init scripts simply because they -are widely used and we feel comfortable with them. If you would prefer to try -something else: Marc Heerdink has written a hint about BSD style init scripts, -to be found at <ulink url="&hints-root;bsd-init.txt"/>. And if you'd like -something more radical, search the LFS mailing lists for "depinit".</para> +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bootscripts.xml"/> -<para>If you decide to use some other style of init scripts, you can skip this -chapter and move on to <xref linkend="chapter-mixture"/>.</para> -</sect1> +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="usage.xml"/> -&bootscripts; -&c7-usage; -&c7-setclock; -&c7-loadkeys; -&c7-sysklogd; -&c7-hostname; -&c7-hosts; -&c7-network; +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="setclock.xml"/> + + +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="loadkeys.xml"/> + + +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/> + + +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hostname.xml"/> -</chapter> +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hosts.xml"/> + + +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="network.xml"/> + + + +</chapter> diff --git a/chapter07/hostname.xml b/chapter07/hostname.xml index ad9ae08d7..c68b5cb2d 100644 --- a/chapter07/hostname.xml +++ b/chapter07/hostname.xml @@ -1,6 +1,15 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> <sect1 id="ch-scripts-hostname"> <title>Configuring the localnet script</title> -<?dbhtml filename="hostname.html" dir="chapter07"?> +<?dbhtml filename="hostname.html"?> + +<indexterm zone="ch-scripts-hostname"> +<primary sortas="d-localnet">localnet</primary> +<secondary>configuring</secondary></indexterm> <para>Part of the localnet script is setting up the system's hostname. This needs to be configured in the /etc/sysconfig/network.</para> @@ -16,4 +25,3 @@ Name) here. That information will be put in the <filename>/etc/hosts</filename> file later on.</para> </sect1> - diff --git a/chapter07/hosts.xml b/chapter07/hosts.xml index 6c1f5eb5c..d83f202b7 100644 --- a/chapter07/hosts.xml +++ b/chapter07/hosts.xml @@ -1,6 +1,21 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> <sect1 id="ch-scripts-hosts"> <title>Creating the /etc/hosts file</title> -<?dbhtml filename="hosts.html" dir="chapter07"?> +<?dbhtml filename="hosts.html"?> + +<indexterm zone="ch-scripts-hosts"><primary sortas="e-/etc/hosts">/etc/hosts</primary></indexterm> + +<indexterm zone="ch-scripts-hosts"> +<primary sortas="d-localnet">localnet</primary> +<secondary>/etc/hosts</secondary></indexterm> + +<indexterm zone="ch-scripts-hosts"> +<primary sortas="d-network">network</primary> +<secondary>/etc/hosts</secondary></indexterm> <para>If a network card is to be configured, you have to decide on the IP-address, FQDN and possible aliases for use in the /etc/hosts file. The @@ -8,7 +23,7 @@ syntax is:</para> <screen><IP address> myhost.example.org aliases</screen> -<para>You should make sure that the IP-address is in the private network +<para>Unless your computer is to be visible to the Internet (e.g. you have a registered domain and a valid block of assigned IP addresses - most of us don't have this)you should make sure that the IP-address is in the private network IP-address range. Valid ranges are:</para> <screen> Class Networks @@ -17,7 +32,7 @@ IP-address range. Valid ranges are:</para> C 192.168.0.0 through 192.168.255.0</screen> <para>A valid IP address could be 192.168.1.1. A valid FQDN for this IP could -be www.linuxfromscratch.org.</para> +be www.linuxfromscratch.org (not recommended as this is a valid registered domain address and could cause your domain name server problems).</para> <para>If you aren't going to use a network card, you still need to come up with a FQDN. This is necessary for certain programs to operate @@ -52,4 +67,3 @@ by a network/system administrator and this machine is planned to be connected to an existing network).</para> </sect1> - diff --git a/chapter07/introduction.xml b/chapter07/introduction.xml new file mode 100644 index 000000000..9f1343c54 --- /dev/null +++ b/chapter07/introduction.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> +<sect1 id="ch-scripts-introduction"> +<title>Introduction</title> +<?dbhtml filename="introduction.html"?> + +<para>In this chapter we will install the bootscripts and set them up +properly. Most of these scripts will work without needing to modify them, but +a few require additional configuration files, since they deal with hardware +dependent information.</para> + +<para>We have chosen to use System-V style init scripts simply because they +are widely used and we feel comfortable with them. If you would prefer to try +something else: Marc Heerdink has written a hint about BSD style init scripts, +to be found at <ulink url="&hints-root;bsd-init.txt"/>. And if you'd like +something more radical, search the LFS mailing lists for <quote>depinit</quote>. +</para> + +<para>If you decide to use some other style of init scripts, you can skip this +chapter and move on to <xref linkend="chapter-bootable"/>.</para> + +</sect1> diff --git a/chapter07/loadkeys.xml b/chapter07/loadkeys.xml index 3628993e9..d3abf96e4 100644 --- a/chapter07/loadkeys.xml +++ b/chapter07/loadkeys.xml @@ -1,18 +1,25 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> <sect1 id="ch-scripts-loadkeys"> <title>Do I need the loadkeys script?</title> -<?dbhtml filename="loadkeys.html" dir="chapter07"?> +<?dbhtml filename="loadkeys.html"?> -<para>If back in <xref linkend="chapter-building-system"/> you decided to go -compile your keymap directly into the kernel (later on in <xref -linkend="chapter-mixture"/>), then strictly speaking you don't need to run this -loadkeys script, since the kernel will set up the keymap for you. If you wish, -you can still run the script, it isn't going to hurt you. Keeping it could even -be beneficial, in case you run a lot of different kernels and can't be sure -that the keymap is compiled into every one of them.</para> +<indexterm zone="ch-scripts-loadkeys"> +<primary sortas="d-loadkeys">loadkeys</primary> +<secondary>configuring</secondary></indexterm> + +<para>If you plan to compile the keymap directly in the kernel during <xref +linkend="chapter-bootable"/> (see <xref linkend="ch-system-kbd"/>), then strictly +speaking you don't need to run this loadkeys script, since the kernel will set +up the keymap for you. If you wish, you can still run the script, it isn't going +to hurt you. Keeping it could even be beneficial, in case you run a lot of +different kernels and can't be sure that the keymap is compiled into every one +of them.</para> <para>If you decided you don't need or don't want to use the loadkeys script, -remove the <filename -class="symlink">/etc/rc.d/rcsysinit.d/S70loadkeys</filename> symlink.</para> +remove the <filename class="symlink">/etc/rc.d/rcsysinit.d/S70loadkeys</filename> symlink.</para> </sect1> - diff --git a/chapter07/network.xml b/chapter07/network.xml index f8a1f3e58..18b44411f 100644 --- a/chapter07/network.xml +++ b/chapter07/network.xml @@ -1,6 +1,15 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> <sect1 id="ch-scripts-network"> <title>Configuring the network script</title> -<?dbhtml filename="network.html" dir="chapter07"?> +<?dbhtml filename="network.html"?> + +<indexterm zone="ch-scripts-network"> +<primary sortas="d-network">network</primary> +<secondary>configuring</secondary></indexterm> <para>This section only applies if you're going to configure a network card.</para> @@ -8,13 +17,13 @@ card.</para> <para>If you don't have any network cards, you are most likely not going to create any configuration files relating to network cards. If that is the case, you must remove the <filename>network</filename> symlinks from all the -runlevel directories +run-level directories (<filename class="directory">/etc/rc.d/rc*.d</filename>)</para> <sect2> <title>Configuring default gateway</title> -<para>If you're on a network you may need to set up the default gateway for +<para>If you're on a network you may need to set up the default gateway (a node on your network that provides access to other networks) for this machine. This is done by adding the proper values to the /etc/sysconfig/network file by running the following:</para> @@ -42,11 +51,12 @@ network interface name (such as eth0 or eth0:1)</para> directory, make sure you update the /etc/sysconfig/rc file as well and update the network_devices by providing it with the new path.</para> -<para>Now, new files are created in that directory containing the following. +<para>Now, new files are created in that directory. The following command creates a sample ifconfig.eth0 file:</para> <screen><userinput>cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"</userinput> ONBOOT=yes +SERVICE=static IP=192.168.1.1 NETMASK=255.255.255.0 BROADCAST=192.168.1.255 @@ -54,18 +64,25 @@ BROADCAST=192.168.1.255 <para>Of course, the values of those variables have to be changed in every file to match the proper setup. If the ONBOOT variable is set -to yes, the network script will bring it up during the booting of the system. -If set to anything else but yes, it will be ignored by the network script -and thus not brought up.</para> +to yes, the network script will bring up the equivalent NIC (Network Interface Card) + during the booting of the system. +If set to anything but yes, the equivalent NIC will be ignored by the network script +and not brought up.</para> + +<para>The SERVICE entry defines the method of obtaining the IP address. +The LFS bootscripts have a modular IP assignment format, and by creating +additional files in /etc/sysconfig/network-devices/services, you can allow +other IP assignment methods. This would commonly be used if you need DHCP, +which is addressed in the BLFS book.</para> </sect2> <sect2> <title>Creating the /etc/resolv.conf file</title> -<para>If you're going to be connected to the internet then most likely you'll -need some means of DNS name resolution to resolve internet domain names to IP -addresses. This is best achieved by placing the IP address of a DNS server +<para>If you're going to be connected to the Internet then most likely you'll +need some means of DNS name resolution to resolve Internet domain names to IP +addresses. This is best achieved by placing the IP address of your DNS, available from your ISP (Internet Service Provider) or network administrator, into <filename>/etc/resolv.conf</filename>. Create the file by running the following:</para> @@ -78,10 +95,9 @@ nameserver <IP address of your nameserver> <userinput>EOF</userinput></screen> <para>Of course, replace <IP address of your nameserver> with the IP -address of the DNS server most appropriate for your setup. This will often be -provided by your ISP or it may even be a router on your local network.</para> +address of the DNS most appropriate for your setup. There will often be +more than one entry (requirements demand secondary servers for fallback capability). The IP address may even be a router on your local network.</para> </sect2> </sect1> - diff --git a/chapter07/setclock.xml b/chapter07/setclock.xml index 5030b170d..5ebdfdc76 100644 --- a/chapter07/setclock.xml +++ b/chapter07/setclock.xml @@ -1,9 +1,18 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> <sect1 id="ch-scripts-setclock"> <title>Configuring the setclock script</title> -<?dbhtml filename="setclock.html" dir="chapter07"?> +<?dbhtml filename="setclock.html"?> -<para>This setclock script reads the time from your hardware clock (also -known as BIOS or CMOS clock) and either converts that time to localtime +<indexterm zone="ch-scripts-setclock"> +<primary sortas="d-setclock">setclock</primary> +<secondary>configuring</secondary></indexterm> + +<para>This setclock script reads the time from your hardware clock, also +known as BIOS or CMOS (Complementry Metal-Oxide Semiconductor) clock, and either converts that time to localtime using the <filename>/etc/localtime</filename> file (if the hardware clock is set to GMT) or not (if the hardware clock is already set to localtime). There is no way to auto-detect whether the hardware clock is set to GMT or @@ -30,4 +39,3 @@ It explains issues such as time zones, UTC, and the TZ environment variable.</para> </sect1> - diff --git a/chapter07/sysklogd.xml b/chapter07/sysklogd.xml index 4c1b02af0..e11cc7f10 100644 --- a/chapter07/sysklogd.xml +++ b/chapter07/sysklogd.xml @@ -1,6 +1,15 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> <sect1 id="ch-scripts-sysklogd"> <title>Configuring the sysklogd script</title> -<?dbhtml filename="sysklogd.html" dir="chapter07"?> +<?dbhtml filename="sysklogd.html"?> + +<indexterm zone="ch-scripts-sysklogd"> +<primary sortas="d-sysklogd">sysklogd</primary> +<secondary>configuring</secondary></indexterm> <para>The <filename>sysklogd</filename> script invokes the <command>syslogd</command> program with the <emphasis>-m 0</emphasis> option. @@ -11,4 +20,3 @@ If you want to turn on this periodic timestamp mark, edit the <userinput>man syslogd</userinput> for more information.</para> </sect1> - diff --git a/chapter07/usage.xml b/chapter07/usage.xml index e0810c403..6fedb31d9 100644 --- a/chapter07/usage.xml +++ b/chapter07/usage.xml @@ -1,21 +1,30 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> <sect1 id="ch-scripts-usage"> <title>How does the booting process with these scripts work?</title> -<?dbhtml filename="usage.html" dir="chapter07"?> +<?dbhtml filename="usage.html"?> + +<indexterm zone="ch-scripts-usage"> +<primary sortas="a-Bootscripts">Bootscripts</primary> +<secondary>usage</secondary></indexterm> <para>Linux uses a special booting facility named SysVinit. It's based on a -concept of <emphasis>runlevels</emphasis>. It can be widely different +concept of <emphasis>run-levels</emphasis>. It can be widely different from one system to another, so it can't be assumed that because things worked in <insert distro name> they should work like that in LFS too. LFS has its own way of doing things, but it respects generally accepted standards.</para> <para>SysVinit (which we'll call <emphasis>init</emphasis> from now on) works -using a runlevels scheme. There are 7 (from 0 to 6) runlevels -(actually, there are more runlevels but they are for special cases and +using a run-levels scheme. There are 7 (from 0 to 6) run-levels +(actually, there are more run-levels but they are for special cases and generally not used. The init man page describes those details), and each one of those corresponds to the things the computer is supposed to do when -it starts up. The default runlevel is 3. Here are the descriptions of the -different runlevels as they are often implemented:</para> +it starts up. The default run-level is 3. Here are the descriptions of the +different run-levels as they are often implemented:</para> <literallayout>0: halt the computer 1: single-user mode @@ -25,20 +34,20 @@ different runlevels as they are often implemented:</para> 5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm) 6: reboot the computer</literallayout> -<para>The command used to change runlevels is <command>init -<runlevel></command> where <runlevel> is the target runlevel. For +<para>The command used to change run-levels is <command>init +<runlevel></command> where <runlevel> is the target run-level. For example, to reboot the computer, a user would issue the <command>init 6</command> command. The <command>reboot</command> command is just an alias for it, as is the <command>halt</command> command an alias for <command>init 0</command>.</para> <para>There are a number of directories under <filename>/etc/rc.d</filename> -that look like like rc?.d where ? is the number of the runlevel and rcsysinit.d -which contain a number of symbolic links. Some begin with a K, the others begin +that look like like rc?.d (where ? is the number of the run-level) and rcsysinit.d +all containing a number of symbolic links. Some begin with a K, the others begin with an S, and all of them have two numbers following the initial letter. The K means to stop (kill) a service, and the S means to start a service. The numbers determine the order in which the scripts are run, from 00 to 99; the lower the -number the sooner it gets executed. When init switches to another runlevel, the +number the sooner it gets executed. When init switches to another run-level, the appropriate services get killed and others get started.</para> <para>The real scripts are in /etc/rc.d/init.d. They do all the work, and the @@ -46,7 +55,7 @@ symlinks all point to them. Killing links and starting links point to the same script in /etc/rc.d/init.d. That's because the scripts can be called with different parameters like start, stop, restart, reload, status. When a K link is encountered, the appropriate script is run with -the stop argument. When a S link is encountered, the appropriate script +the stop argument. When an S link is encountered, the appropriate script is run with the start argument.</para> <para>There is one exception. Links that start with an S in the @@ -85,4 +94,3 @@ own LFS system). The files given here are just an example of how it can be done in a nice way (well, what we consider nice -- you may hate it).</para> </sect1> - |