diff options
author | Mark Hymers <markh@linuxfromscratch.org> | 2001-07-22 19:45:10 +0000 |
---|---|---|
committer | Mark Hymers <markh@linuxfromscratch.org> | 2001-07-22 19:45:10 +0000 |
commit | b822811980a5f82726cb641cbeff66be9eb6d92a (patch) | |
tree | 27c4db3c62aaea065b053e43c39b2ba44c04a05f /chapter07 | |
parent | 46f5461af92bc70c62bbb92895032b930954d835 (diff) |
XML changes
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@827 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07')
-rw-r--r-- | chapter07/checkfs.xml | 16 | ||||
-rw-r--r-- | chapter07/createdirs.xml | 14 | ||||
-rw-r--r-- | chapter07/ethnet.xml | 81 | ||||
-rw-r--r-- | chapter07/functions.xml | 16 | ||||
-rw-r--r-- | chapter07/halt.xml | 14 | ||||
-rw-r--r-- | chapter07/hosts.xml | 93 | ||||
-rw-r--r-- | chapter07/introduction.xml | 20 | ||||
-rw-r--r-- | chapter07/loadkeys.xml | 16 | ||||
-rw-r--r-- | chapter07/localnet.xml | 16 | ||||
-rw-r--r-- | chapter07/mountfs.xml | 18 | ||||
-rw-r--r-- | chapter07/network.xml | 22 | ||||
-rw-r--r-- | chapter07/rc.xml | 18 | ||||
-rw-r--r-- | chapter07/rcS.xml | 18 | ||||
-rw-r--r-- | chapter07/reboot.xml | 16 | ||||
-rw-r--r-- | chapter07/sendsignals.xml | 16 | ||||
-rw-r--r-- | chapter07/setclock.xml | 62 | ||||
-rw-r--r-- | chapter07/symperm.xml | 22 | ||||
-rw-r--r-- | chapter07/sysklogd.xml | 16 | ||||
-rw-r--r-- | chapter07/template.xml | 16 | ||||
-rw-r--r-- | chapter07/usage.xml | 81 |
20 files changed, 195 insertions, 396 deletions
diff --git a/chapter07/checkfs.xml b/chapter07/checkfs.xml index 60c6bc27f..2857eeea2 100644 --- a/chapter07/checkfs.xml +++ b/chapter07/checkfs.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-checkfs"> <title>Creating the checkfs script</title> -<para> -Create the <filename>/etc/init.d/checkfs</filename> script by running -the following command: -</para> - -<para> -<screen> -<userinput>cat > checkfs << "EOF"</userinput> +<para>Create the <filename>/etc/init.d/checkfs</filename> script by running +the following command:</para> + +<para><screen><userinput>cat > checkfs << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/checkfs @@ -108,9 +104,7 @@ else fi # End /etc/init.d/checkfs -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/createdirs.xml b/chapter07/createdirs.xml index 90980d264..6a6ee3470 100644 --- a/chapter07/createdirs.xml +++ b/chapter07/createdirs.xml @@ -1,18 +1,12 @@ <sect1 id="ch07-createdirs"> <title>Creating directories</title> -<para> -We need to start by creating a few extra directories that are used by -the boot scripts. These directories are created by running: -</para> +<para>We need to start by creating a few extra directories that are used by +the boot scripts. These directories are created by running:</para> -<para> -<screen> -<userinput>cd /etc &&</userinput> +<para><screen><userinput>cd /etc &&</userinput> <userinput>mkdir rc{0,1,2,3,4,5,6,S}.d init.d sysconfig &&</userinput> -<userinput>cd init.d</userinput> -</screen> -</para> +<userinput>cd init.d</userinput></screen></para> </sect1> diff --git a/chapter07/ethnet.xml b/chapter07/ethnet.xml index f9687161b..d1b593b30 100644 --- a/chapter07/ethnet.xml +++ b/chapter07/ethnet.xml @@ -1,19 +1,13 @@ <sect1 id="ch07-ethnet"> <title>Creating the /etc/init.d/ethnet script</title> -<para> -This section only applies if a user is going to configure a network card. -If not, this section can be skipped. -</para> - -<para> -Create the <filename>/etc/init.d/ethnet</filename> script by running the -following command: -</para> - -<para> -<screen> -<userinput>cat > /etc/init.d/ethnet << "EOF"</userinput> +<para>This section only applies if a user is going to configure a network card. +If not, this section can be skipped.</para> + +<para>Create the <filename>/etc/init.d/ethnet</filename> script by running the +following command:</para> + +<para><screen><userinput>cat > /etc/init.d/ethnet << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/ethnet # @@ -114,82 +108,57 @@ case "$1" in esac # End /etc/init.d/ethnet -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> <sect2> <title>Adding default gateway to /etc/sysconfig/network</title> -<para> -If a default gateway is required to be setup, the following command does that: -</para> +<para>If a default gateway is required to be setup, the +following command does that:</para> -<para> -<screen> -<userinput>cat >> /etc/sysconfig/network << "EOF"</userinput> +<para><screen><userinput>cat >> /etc/sysconfig/network << "EOF"</userinput> GATEWAY=192.168.1.2 GATEWAY_IF=eth0 -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> -<para> -GATEWAY and GATEWAY_IF need to be changed to match the network setup. +<para>GATEWAY and GATEWAY_IF need to be changed to match the network setup. GATEWAY contains the address of the default gateway, and GATEWAY_IF contains the network interface through which that default gateway can -be reached. -</para> +be reached.</para> </sect2> <sect2> <title>Creating NIC configuration files</title> -<para> -Which interfaces are brought up and down by the ethnet script depends on +<para>Which interfaces are brought up and down by the ethnet script depends on the files in the /etc/sysconfig/nic-config directory. This directory should contain files in the form of ifcfg-x where x is an -identification number (or whatever a user named it). -</para> - -<para> -First the nic-config directory is created by running: -</para> +identification number (or whatever a user named it).</para> -<para> -<screen> -<userinput>mkdir /etc/sysconfig/nic-config</userinput> -</screen> -</para> +<para>First the nic-config directory is created by running:</para> -<para> +<para><screen><userinput>mkdir +/etc/sysconfig/nic-config</userinput></screen></para> -Now, new files are created in that directory containing the following. -The following command creates a sample file ifcfg-eth0: -</para> +<para>Now, new files are created in that directory containing the following. +The following command creates a sample file ifcfg-eth0:</para> -<para> -<screen> -<userinput>cat > /etc/sysconfig/nic-config/ifcfg-eth0 << "EOF"</userinput> +<para><screen><userinput>cat > /etc/sysconfig/nic-config/ifcfg-eth0 << "EOF"</userinput> ONBOOT=yes DEVICE=eth0 IP=192.168.1.1 NETMASK=255.255.255.0 BROADCAST=192.168.1.255 -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> -<para> -Of course, the values of those four variables have to be changed +<para>Of course, the values of those four variables have to be changed in every file to match the proper setup. Usually NETMASK and BROADCAST will remain the same, just the DEVICE IP variables will change per network interface. If the ONBOOT variable is set to yes, the ethnet script will bring it up during boot up of the system. If set to anything else but yes it will be -ignored by the ethnet script and thus not brought up. -</para> +ignored by the ethnet script and thus not brought up.</para> </sect2> diff --git a/chapter07/functions.xml b/chapter07/functions.xml index fb99da658..d82ff60cd 100644 --- a/chapter07/functions.xml +++ b/chapter07/functions.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-functions"> <title>Creating the functions script</title> -<para> -Create the <filename>/etc/init.d/functions</filename> script by running -the following command: -</para> - -<para> -<screen> -<userinput>cat > functions << "EOF"</userinput> +<para>Create the <filename>/etc/init.d/functions</filename> script by running +the following command:</para> + +<para><screen><userinput>cat > functions << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/functions @@ -503,9 +499,7 @@ statusproc() } # End /etc/init.d/functions -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/halt.xml b/chapter07/halt.xml index 962b0cb78..82eaee109 100644 --- a/chapter07/halt.xml +++ b/chapter07/halt.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-halt"> <title>Creating the halt script</title> -<para> -Create the <filename>/etc/init.d/halt</filename> script by running the -following command: -</para> +<para>Create the <filename>/etc/init.d/halt</filename> script by running the +following command:</para> -<para> -<screen> -<userinput>cat > halt << "EOF"</userinput> +<para><screen><userinput>cat > halt << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/halt @@ -19,9 +15,7 @@ following command: /sbin/halt -d -f -i -p # End /etc/init.d/halt -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/hosts.xml b/chapter07/hosts.xml index e2a1159ea..d3ae0c6b7 100644 --- a/chapter07/hosts.xml +++ b/chapter07/hosts.xml @@ -1,84 +1,55 @@ <sect1 id="ch07-hosts"> <title>Creating the /etc/hosts file</title> -<para> -If a network card is to be configured, a user has to decide on the +<para>If a network card is to be configured, a user has to decide on the IP-address, FQDN and possible aliases for use in the /etc/hosts file. An -example is: -</para> - -<para> -<screen> -<my-IP> myhost.mydomain.org aliases -</screen> -</para> - -<para> -It should made sure that the IP-address is in the private network -IP-address range. Valid ranges are: -</para> - -<para> -<screen> - Class Networks +example is:</para> + +<para><screen><my-IP> myhost.mydomain.org aliases</screen></para> + +<para>It should made sure that the IP-address is in the private network +IP-address range. Valid ranges are:</para> + +<para><screen> Class Networks A 10.0.0.0 B 172.16.0.0 through 172.31.0.0 - C 192.168.0.0 through 192.168.255.0 -</screen> -</para> - -<para> -A valid IP address could be 192.168.1.1. A valid FQDN for this IP could -be www.linuxfromscratch.org -</para> - -<para> -If a user is not going to use a network card, he still needs to come up with a -FQDN. This is necessary for programs like Sendmail to operate correctly (in -fact; Sendmail won't run when it can't determine the FQDN). -</para> - -<para> -If a network card is not going to be configured, a new file -<filename>/etc/hosts</filename> is created by running: -</para> - -<para> -<screen> -<userinput>cat > /etc/hosts << "EOF"</userinput> + C 192.168.0.0 through 192.168.255.0</screen></para> + +<para>A valid IP address could be 192.168.1.1. A valid FQDN for this IP could +be www.linuxfromscratch.org</para> + +<para>If a user is not going to use a network card, he still needs to +come up with a FQDN. This is necessary for programs like Sendmail to operate +correctly (in fact; Sendmail won't run when it can't determine the FQDN).</para> + +<para>If a network card is not going to be configured, a new file +<filename>/etc/hosts</filename> is created by running:</para> + +<para><screen><userinput>cat > /etc/hosts << "EOF"</userinput> # Begin /etc/hosts (no network card version) 127.0.0.1 www.mydomain.com <value of HOSTNAME> localhost # End /etc/hosts (no network card version) -<userinput>EOF</userinput> -</screen> -</para> - -<para> -If a network card is to be configured, a new file -<filename>/etc/hosts</filename> is created by running: -</para> - -<para> -<screen> -<userinput>cat > /etc/hosts << "EOF"</userinput> +<userinput>EOF</userinput></screen></para> + +<para>If a network card is to be configured, a new file +<filename>/etc/hosts</filename> is created by running:</para> + +<para><screen><userinput>cat > /etc/hosts << "EOF"</userinput> # Begin /etc/hosts (network card version) 127.0.0.1 localhost.localdomain localhost 192.168.1.1 www.mydomain.org <value of HOSTNAME> # End /etc/hosts (network card version) -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> -<para> -Of course, the 192.168.1.1 and www.mydomain.org have to be changed to the +<para>Of course, the 192.168.1.1 and www.mydomain.org have to be changed to the users liking (or requirements if assigned an IP-address by a network/system -administrator and this machine is planned to be connected to that network). -</para> +administrator and this machine is planned to be +connected to that network).</para> </sect1> diff --git a/chapter07/introduction.xml b/chapter07/introduction.xml index 74b49b8f4..f1ccae996 100644 --- a/chapter07/introduction.xml +++ b/chapter07/introduction.xml @@ -1,21 +1,19 @@ <sect1 id="ch07-introduction"> <title>Introduction</title> -<para> -This chapter will create the necessary scripts that are run at boot time. +<para>This chapter will create the necessary scripts that are run at boot time. These scripts perform tasks such as remounting the root file system mounted read-only by the kernel into read-write mode, activating the swap partition(s), running a check on the root file system to make sure it's -intact, setting up networking and starting the daemons that the system uses. -</para> +intact, setting up networking and starting the daemons that the +system uses.</para> -<para> -We will be using SysV style init scripts. We have chosen this style because it -is widely used and we feel confortable with it. If you want to try something -else, someone has written an LFS-Hint on BSD style init scripts at <ulink -url="http://archive.linuxfromscratch.org/lfs-hints/bsd-init.txt"> -http://archive.linuxfromscratch.org/lfs-hints/bsd-init.txt</ulink>. -</para> +<para>We will be using SysV style init scripts. We have chosen this style +because it is widely used and we feel confortable with it. If you want to +try something else, someone has written an LFS-Hint on BSD style init scripts +at <ulink +url="http://archive.linuxfromscratch.org/lfs-hints/bsd-init.txt">http://archive.linuxfromscratch.org/lfs-hints/bsd-init.txt</ulink> +.</para> </sect1> diff --git a/chapter07/loadkeys.xml b/chapter07/loadkeys.xml index 74da28e9e..f103583a8 100644 --- a/chapter07/loadkeys.xml +++ b/chapter07/loadkeys.xml @@ -1,16 +1,12 @@ <sect1 id="ch07-loadkeys"> <title>Creating the loadkeys script</title> -<para> -A user only needs to create this script if he don't have a default 101 keys -US keyboard layout. Create the +<para>A user only needs to create this script if he don't have a +default 101 keys US keyboard layout. Create the <filename>/etc/init.d/loadkeys</filename> script by running the -following command: -</para> +following command:</para> -<para> -<screen> -<userinput>cat > loadkeys << "EOF"</userinput> +<para><screen><userinput>cat > loadkeys << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/loadkeys @@ -29,9 +25,7 @@ echo -n "Loading keymap..." evaluate_retval # End /etc/init.d/loadkeys -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/localnet.xml b/chapter07/localnet.xml index 60a5bae68..f7d2fa250 100644 --- a/chapter07/localnet.xml +++ b/chapter07/localnet.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-localnet"> <title>Creating the /etc/init.d/localnet boot script</title> -<para> -Create the <filename>/etc/init.d/localnet</filename> script by running -the following command: -</para> - -<para> -<screen> -<userinput>cat > /etc/init.d/localnet << "EOF"</userinput> +<para>Create the <filename>/etc/init.d/localnet</filename> script by running +the following command:</para> + +<para><screen><userinput>cat > /etc/init.d/localnet << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/localnet @@ -49,9 +45,7 @@ case "$1" in esac # End /etc/init.d/localnet -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/mountfs.xml b/chapter07/mountfs.xml index b6432e022..1ffa16306 100644 --- a/chapter07/mountfs.xml +++ b/chapter07/mountfs.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-mountfs"> <title>Creating the mountfs script</title> -<para> -Create the <filename>/etc/init.d/mountfs</filename> script by running -the following command: -</para> - -<para> -<screen> -<userinput>cat > mountfs << "EOF"</userinput> +<para>Create the <filename>/etc/init.d/mountfs</filename> script by running +the following command:</para> + +<para><screen><userinput>cat > mountfs << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/mountfs @@ -43,7 +39,7 @@ case "$1" in # file which contains a list of currently mounted file systems. # - echo > /etc/mtab + echo > /etc/mtab /bin/mount -f -o remount,rw / # @@ -102,9 +98,7 @@ case "$1" in esac # End /etc/init.d/mountfs -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/network.xml b/chapter07/network.xml index f9cea6f1e..958e6d367 100644 --- a/chapter07/network.xml +++ b/chapter07/network.xml @@ -1,24 +1,16 @@ <sect1 id="ch07-network"> <title>Creating the /etc/sysconfig/network file</title> -<para> -A new file <filename>/etc/sysconfig/network</filename> is created and the -hostname is put in it by running: -</para> +<para>A new file <filename>/etc/sysconfig/network</filename> is created and the +hostname is put in it by running:</para> -<para> -<screen> -<userinput>echo "HOSTNAME=lfs" > /etc/sysconfig/network</userinput> -</screen> -</para> +<para><screen><userinput>echo "HOSTNAME=lfs" > +/etc/sysconfig/network</userinput></screen></para> -<para> -<quote>lfs</quote> needs to be replaced by the name the computer is to be -called. -A user should not enter the FQDN (Fully Qualified Domain +<para><quote>lfs</quote> needs to be replaced by the name the computer is +to be called. A user should not enter the FQDN (Fully Qualified Domain Name) here. That information will be put in the -<filename>/etc/hosts</filename> file later. -</para> +<filename>/etc/hosts</filename> file later.</para> </sect1> diff --git a/chapter07/rc.xml b/chapter07/rc.xml index 94121acb0..321c3cb7f 100644 --- a/chapter07/rc.xml +++ b/chapter07/rc.xml @@ -1,15 +1,11 @@ <sect1 id="ch07-rc"> <title>Creating the rc script</title> -<para> -The first main boot script is the <filename>/etc/init.d/rc</filename> script. -Create the <filename>/etc/init.d/rc</filename> script by running the -following command: -</para> - -<para> -<screen> -<userinput>cat > rc << "EOF"</userinput> +<para>The first main boot script is the <filename>/etc/init.d/rc</filename> +script. Create the <filename>/etc/init.d/rc</filename> script by running the +following command:</para> + +<para><screen><userinput>cat > rc << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/rc # @@ -246,9 +242,7 @@ then fi # End /etc/init.d/rc -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/rcS.xml b/chapter07/rcS.xml index d68a7e40c..0014d77b3 100644 --- a/chapter07/rcS.xml +++ b/chapter07/rcS.xml @@ -1,15 +1,11 @@ <sect1 id="ch07-rcS"> <title>Creating the rcS script</title> -<para> -The second main boot script is the <filename>rcS</filename> script. Create -the <filename>/etc/init.d/rcS</filename> script by running the following -command: -</para> - -<para> -<screen> -<userinput>cat > rcS << "EOF"</userinput> +<para>The second main boot script is the <filename>rcS</filename> script. +Create the <filename>/etc/init.d/rcS</filename> script by running the following +command:</para> + +<para><screen><userinput>cat > rcS << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/rcS @@ -36,9 +32,7 @@ do done # End /etc/init.d/rcS -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/reboot.xml b/chapter07/reboot.xml index b65c1ebc9..3b69e5088 100644 --- a/chapter07/reboot.xml +++ b/chapter07/reboot.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-reboot"> <title>Creating the reboot script</title> -<para> -Create the <filename>/etc/init.d/reboot</filename> script by running the -following command: -</para> - -<para> -<screen> -<userinput>cat > reboot << "EOF"</userinput> +<para>Create the <filename>/etc/init.d/reboot</filename> script by running the +following command:</para> + +<para><screen><userinput>cat > reboot << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/reboot @@ -22,9 +18,7 @@ echo "System reboot in progress..." /sbin/reboot -d -f -i # End /etc/init.d/reboot -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/sendsignals.xml b/chapter07/sendsignals.xml index 28a306ffa..55ba5dbae 100644 --- a/chapter07/sendsignals.xml +++ b/chapter07/sendsignals.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-sendsignals"> <title>Creating the sendsignals script</title> -<para> -Creat the <filename>/etc/init.d/sendsignals</filename> script by running -the following command: -</para> - -<para> -<screen> -<userinput>cat > sendsignals << "EOF"</userinput> +<para>Creat the <filename>/etc/init.d/sendsignals</filename> script by running +the following command:</para> + +<para><screen><userinput>cat > sendsignals << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/sendsignals @@ -36,9 +32,7 @@ echo -n "Sending all processes the KILL signal..." evaluate_retval # End /etc/init.d/sendsignals -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/setclock.xml b/chapter07/setclock.xml index 613c39323..a7ea9f2b6 100644 --- a/chapter07/setclock.xml +++ b/chapter07/setclock.xml @@ -1,8 +1,7 @@ <sect1 id="ch07-setclock"> <title>Creating the setclock script</title> -<para> -The following script is only for real use when the hardware clock (also +<para>The following script is only for real use when the hardware clock (also known as BIOS or CMOS clock) isn't set to GMT time. The recommended setup is setting the hardware clock to GMT and having the time converted to localtime using the /etc/localtime symbolic link. But if an @@ -10,23 +9,16 @@ OS is run that doesn't understand a clock set to GMT (most notable are Microsoft OS'es) a user might want to set the clock to localtime so that the time is properly displayed on those OS'es. This script will reset the kernel time to the hardware clock without converting the time using -the /etc/localtime symlink. -</para> +the /etc/localtime symlink.</para> -<para> -If you want to use this script on your system even if the +<para>If you want to use this script on your system even if the hardware clock is set to GMT, then the UTC variable below has to be -changed to the value of <emphasis>1</emphasis>. -</para> +changed to the value of <emphasis>1</emphasis>.</para> -<para> -Creat the <filename>/etc/init.d/setclock</filename> script by running -the following command: -</para> +<para>Create the <filename>/etc/init.d/setclock</filename> script by running +the following command:</para> -<para> -<screen> -<userinput>cat > setclock << "EOF"</userinput> +<para><screen><userinput>cat > setclock << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/setclock @@ -65,45 +57,31 @@ echo -n "Setting clock..." evaluate_retval # End /etc/init.d/setclock -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> <sect2> <title>Creating the /etc/sysconfig/clock file</title> -<para> -Create a new file <filename>/etc/sysconfig/clock</filename> by running -the following: -</para> +<para>Create a new file <filename>/etc/sysconfig/clock</filename> by running +the following:</para> -<para> -<screen> -<userinput>cat > /etc/sysconfig/clock << "EOF"</userinput> +<para><screen><userinput>cat > /etc/sysconfig/clock << "EOF"</userinput> # Begin /etc/sysconfig/clock UTC=1 # End /etc/sysconfig/clock -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> -<para> -If the hardware clock (also known as BIOS or CMOS clock) is not set to +<para>If the hardware clock (also known as BIOS or CMOS clock) is not set to GMT time, then the UTC variable in the /etc/sysconfig/clock file needs to be -set to -the value <emphasis>0</emphasis> (zero). -</para> - -<para> -Now, you may want to take a look at a very good hint explaining how we -deal with time on LFS at -<ulink url="http://archive.linuxfromscratch.org/lfs-hints/time.txt"> -http://archive.linuxfromscratch.org/lfs-hints/time.txt</ulink>. -It explains issues such as timezones, UTC, and the TZ -environment variable. -</para> +set to the value <emphasis>0</emphasis> (zero).</para> + +<para>Now, you may want to take a look at a very good hint explaining how we +deal with time on LFS at <ulink +url="http://archive.linuxfromscratch.org/lfs-hints/time.txt">http://archive.linuxfromscratch.org/lfs-hints/time.txt</ulink>. +It explains issues such as timezones, UTC, and the TZ +environment variable.</para> </sect2> diff --git a/chapter07/symperm.xml b/chapter07/symperm.xml index fc8db2e00..32c4a0a1c 100644 --- a/chapter07/symperm.xml +++ b/chapter07/symperm.xml @@ -1,25 +1,19 @@ <sect1 id="ch07-symperm"> <title>Setting up symlinks and permissions</title> -<para> -These files get the proper permissions and the necessary symlinks are created -by running the following commands. If you didn't create the loadkeys -and setclock scripts, make sure not to type them in the commands below. -</para> +<para>These files get the proper permissions and the necessary symlinks +are created by running the following commands. If you didn't create the loadkeys +and setclock scripts, make sure not to type them in the commands below.</para> -<para> -A note of caution: all the symlinks (that start with an S or K) have to +<para>A note of caution: all the symlinks (that start with an S or K) have to be of the form Sxxxname where xxx are three digits donating the order in which the script is executed (the lower the number the sooner it's executed). If you feel a need to use less than three digits, make sure you pad with extra zero's at the beginning. This means, don't use S20mydaemon, but S020mydaemon. And don't use K2otherdaemon, but -K002otherdaemon. -</para> +K002otherdaemon.</para> -<para> -<screen> -<userinput>cd /etc/init.d &&</userinput> +<para><screen><userinput>cd /etc/init.d &&</userinput> <userinput>chmod 754 rc rcS functions checkfs halt loadkeys mountfs reboot &&</userinput> <userinput>chmod 754 sendsignals setclock sysklogd template &&</userinput> <userinput>chmod 754 localnet ethnet &&</userinput> @@ -55,9 +49,7 @@ K002otherdaemon. <userinput>ln -s ../init.d/ethnet S200ethnet &&</userinput> <userinput>cd ../rc5.d &&</userinput> <userinput>ln -s ../init.d/sysklogd S100sysklogd &&</userinput> -<userinput>ln -s ../init.d/ethnet S200ethnet</userinput> -</screen> -</para> +<userinput>ln -s ../init.d/ethnet S200ethnet</userinput></screen></para> </sect1> diff --git a/chapter07/sysklogd.xml b/chapter07/sysklogd.xml index 81feb1e79..6cf8c1d12 100644 --- a/chapter07/sysklogd.xml +++ b/chapter07/sysklogd.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-sysklogd"> <title>Creating the sysklogd script</title> -<para> -Create the <filename>/etc/init.d/sysklogd</filename> script by running -the following command: -</para> - -<para> -<screen> -<userinput>cat > sysklogd << "EOF"</userinput> +<para>Create the <filename>/etc/init.d/sysklogd</filename> script by running +the following command:</para> + +<para><screen><userinput>cat > sysklogd << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/sysklogd @@ -59,9 +55,7 @@ case "$1" in esac # End /etc/init.d/sysklogd -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/template.xml b/chapter07/template.xml index 72a0b93f7..91e65216b 100644 --- a/chapter07/template.xml +++ b/chapter07/template.xml @@ -1,14 +1,10 @@ <sect1 id="ch07-template"> <title>Creating the template script</title> -<para> -Create the <filename>/etc/init.d/template</filename> script by running -the following command: -</para> - -<para> -<screen> -<userinput>cat > template << "EOF"</userinput> +<para>Create the <filename>/etc/init.d/template</filename> script by running +the following command:</para> + +<para><screen><userinput>cat > template << "EOF"</userinput> #!/bin/sh # Begin /etc/init.d/ @@ -52,9 +48,7 @@ case "$1" in esac # End /etc/init.d/ -<userinput>EOF</userinput> -</screen> -</para> +<userinput>EOF</userinput></screen></para> </sect1> diff --git a/chapter07/usage.xml b/chapter07/usage.xml index e20e3cb53..1e8c944f1 100644 --- a/chapter07/usage.xml +++ b/chapter07/usage.xml @@ -1,51 +1,40 @@ <sect1 id="ch07-usage"> <title>How does the booting process with these scripts work?</title> -<para> -Linux uses a special booting facility named SysVinit. It's based on a +<para>Linux uses a special booting facility named SysVinit. It's based on a concept of <emphasis>runlevels</emphasis>. It can be widely different from one system to another, so it can not be assumed that because things worked in <insert distro name> they should work like that in LFS too. LFS has it's own way of doing things, but it respects generally -accepted standards. -</para> +accepted standards.</para> -<para> -SysVinit (which we'll call <emphasis>init</emphasis> from now on) works +<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 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> +different runlevels as they are often implemented:</para> -<literallayout> -0: halt the computer +<literallayout>0: halt the computer 1: single-user mode 2: multi-user mode without networking 3: multi-user mode with networking 4: reserved for customization, otherwise does the same as 3 5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm) -6: reboot the computer -</literallayout> +6: reboot the computer</literallayout> -<para> -The command used to change runlevels is <userinput>init +<para>The command used to change runlevels is <userinput>init <runlevel></userinput> where <runlevel> is the target runlevel. For example, to reboot the computer, a user would issue the init 6 command. The reboot command is just an alias, as is the halt -command an alias to init 0. -</para> +command an alias to init 0.</para> -<para> -The /etc/init.d/rcS script is run at every startup of the computer, +<para>The /etc/init.d/rcS script is run at every startup of the computer, before any runlevel is executed and runs the scripts listed in -/etc/rcS.d -</para> +/etc/rcS.d</para> -<para> -There are a number of directories under /etc that look like like rc?.d +<para>There are a number of directories under /etc that look like like rc?.d where ? is the number of the runlevel and rcS.d. A user might take a look at one of them (after this chapter is finished, right now there's nothing @@ -55,55 +44,43 @@ 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 000 to 999; the lower the number the sooner it gets executed. When init switches to another runlevel, the appropriate -services get killed and others get started. -</para> +services get killed and others get started.</para> -<para> -The real scripts are in /etc/init.d. They do all the work, and the +<para>The real scripts are in /etc/init.d. They do all the work, and the symlinks all point to them. Killing links and starting links point to the same script in /etc/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 -is run with the start argument. -</para> +is run with the start argument.</para> -<para> -These are descriptions of what the arguments make the scripts do: -</para> +<para>These are descriptions of what the arguments make the +scripts do:</para> <itemizedlist> -<listitem><para> -<emphasis>start</emphasis>: The service is started. -</para></listitem> +<listitem><para><emphasis>start</emphasis>: The service is +started.</para></listitem> -<listitem><para> -<emphasis>stop</emphasis>: The service is stopped. -</para></listitem> +<listitem><para><emphasis>stop</emphasis>: The service is +stopped.</para></listitem> -<listitem><para> -<emphasis>restart</emphasis>: The service is stopped and then started again. -</para></listitem> +<listitem><para><emphasis>restart</emphasis>: The service is +stopped and then started again.</para></listitem> -<listitem><para> -<emphasis>reload</emphasis>: The configuration of the service is updated. +<listitem><para><emphasis>reload</emphasis>: The configuration +of the service is updated. This is used after the configuration file of a service was modified, when -the service doesn't need to be restarted. -</para></listitem> +the service doesn't need to be restarted.</para></listitem> -<listitem><para> -<emphasis>status</emphasis>: Tells if the service is running and with -which PID's. -</para></listitem> +<listitem><para><emphasis>status</emphasis>: Tells if the service +is running and with which PID's.</para></listitem> </itemizedlist> -<para> -Feel free to modify the way the boot process works (after all it's your +<para>Feel free to modify the way the boot process works (after all it's your LFS system, not ours). The files here are just an example of how it can be -done in a nice way (well what we consider nice anyway. You may hate it). -</para> +done in a nice way (well what we consider nice anyway. You may hate it).</para> </sect1> |