- Timestamp:
- 07/22/2001 07:45:10 PM (23 years ago)
- 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, 12.2, 12.2-rc1, 6.0, 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, v3_0, v3_1, v3_2, v3_3, v4_0, v4_1, v5_0, v5_1, v5_1_1, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- f1da843
- Parents:
- 46f5461
- Location:
- chapter07
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/checkfs.xml
r46f5461 rb822811 2 2 <title>Creating the checkfs script</title> 3 3 4 <para> 5 Create the <filename>/etc/init.d/checkfs</filename> script by running 6 the following command: 7 </para> 4 <para>Create the <filename>/etc/init.d/checkfs</filename> script by running 5 the following command:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cat > checkfs << "EOF"</userinput> 7 <para><screen><userinput>cat > checkfs << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/checkfs … … 109 105 110 106 # End /etc/init.d/checkfs 111 <userinput>EOF</userinput> 112 </screen> 113 </para> 107 <userinput>EOF</userinput></screen></para> 114 108 115 109 </sect1> -
chapter07/createdirs.xml
r46f5461 rb822811 2 2 <title>Creating directories</title> 3 3 4 <para> 5 We need to start by creating a few extra directories that are used by 6 the boot scripts. These directories are created by running: 7 </para> 4 <para>We need to start by creating a few extra directories that are used by 5 the boot scripts. These directories are created by running:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cd /etc &&</userinput> 7 <para><screen><userinput>cd /etc &&</userinput> 12 8 <userinput>mkdir rc{0,1,2,3,4,5,6,S}.d init.d sysconfig &&</userinput> 13 <userinput>cd init.d</userinput> 14 </screen> 15 </para> 9 <userinput>cd init.d</userinput></screen></para> 16 10 17 11 </sect1> -
chapter07/ethnet.xml
r46f5461 rb822811 2 2 <title>Creating the /etc/init.d/ethnet script</title> 3 3 4 <para> 5 This section only applies if a user is going to configure a network card. 6 If not, this section can be skipped. 7 </para> 4 <para>This section only applies if a user is going to configure a network card. 5 If not, this section can be skipped.</para> 8 6 9 <para> 10 Create the <filename>/etc/init.d/ethnet</filename> script by running the 11 following command: 12 </para> 7 <para>Create the <filename>/etc/init.d/ethnet</filename> script by running the 8 following command:</para> 13 9 14 <para> 15 <screen> 16 <userinput>cat > /etc/init.d/ethnet << "EOF"</userinput> 10 <para><screen><userinput>cat > /etc/init.d/ethnet << "EOF"</userinput> 17 11 #!/bin/sh 18 12 # Begin /etc/init.d/ethnet … … 115 109 116 110 # End /etc/init.d/ethnet 117 <userinput>EOF</userinput> 118 </screen> 119 </para> 111 <userinput>EOF</userinput></screen></para> 120 112 121 113 <sect2> 122 114 <title>Adding default gateway to /etc/sysconfig/network</title> 123 115 124 <para> 125 If a default gateway is required to be setup, the following command does that: 126 </para> 116 <para>If a default gateway is required to be setup, the 117 following command does that:</para> 127 118 128 <para> 129 <screen> 130 <userinput>cat >> /etc/sysconfig/network << "EOF"</userinput> 119 <para><screen><userinput>cat >> /etc/sysconfig/network << "EOF"</userinput> 131 120 GATEWAY=192.168.1.2 132 121 GATEWAY_IF=eth0 133 <userinput>EOF</userinput> 134 </screen> 135 </para> 122 <userinput>EOF</userinput></screen></para> 136 123 137 <para> 138 GATEWAY and GATEWAY_IF need to be changed to match the network setup. 124 <para>GATEWAY and GATEWAY_IF need to be changed to match the network setup. 139 125 GATEWAY contains the address of the default gateway, and GATEWAY_IF 140 126 contains the network interface through which that default gateway can 141 be reached. 142 </para> 127 be reached.</para> 143 128 144 129 </sect2> … … 147 132 <title>Creating NIC configuration files</title> 148 133 149 <para> 150 Which interfaces are brought up and down by the ethnet script depends on 134 <para>Which interfaces are brought up and down by the ethnet script depends on 151 135 the files in the /etc/sysconfig/nic-config directory. This 152 136 directory should contain files in the form of ifcfg-x where x is an 153 identification number (or whatever a user named it). 154 </para> 137 identification number (or whatever a user named it).</para> 155 138 156 <para> 157 First the nic-config directory is created by running: 158 </para> 139 <para>First the nic-config directory is created by running:</para> 159 140 160 <para> 161 <screen> 162 <userinput>mkdir /etc/sysconfig/nic-config</userinput> 163 </screen> 164 </para> 141 <para><screen><userinput>mkdir 142 /etc/sysconfig/nic-config</userinput></screen></para> 165 143 166 <para> 144 <para>Now, new files are created in that directory containing the following. 145 The following command creates a sample file ifcfg-eth0:</para> 167 146 168 Now, new files are created in that directory containing the following. 169 The following command creates a sample file ifcfg-eth0: 170 </para> 171 172 <para> 173 <screen> 174 <userinput>cat > /etc/sysconfig/nic-config/ifcfg-eth0 << "EOF"</userinput> 147 <para><screen><userinput>cat > /etc/sysconfig/nic-config/ifcfg-eth0 << "EOF"</userinput> 175 148 ONBOOT=yes 176 149 DEVICE=eth0 … … 178 151 NETMASK=255.255.255.0 179 152 BROADCAST=192.168.1.255 180 <userinput>EOF</userinput> 181 </screen> 182 </para> 153 <userinput>EOF</userinput></screen></para> 183 154 184 <para> 185 Of course, the values of those four variables have to be changed 155 <para>Of course, the values of those four variables have to be changed 186 156 in every file to 187 157 match the proper setup. Usually NETMASK and BROADCAST will remain the … … 189 159 the ONBOOT variable is set to yes, the ethnet script will bring it up 190 160 during boot up of the system. If set to anything else but yes it will be 191 ignored by the ethnet script and thus not brought up. 192 </para> 161 ignored by the ethnet script and thus not brought up.</para> 193 162 194 163 </sect2> -
chapter07/functions.xml
r46f5461 rb822811 2 2 <title>Creating the functions script</title> 3 3 4 <para> 5 Create the <filename>/etc/init.d/functions</filename> script by running 6 the following command: 7 </para> 8 9 <para> 10 <screen> 11 <userinput>cat > functions << "EOF"</userinput> 4 <para>Create the <filename>/etc/init.d/functions</filename> script by running 5 the following command:</para> 6 7 <para><screen><userinput>cat > functions << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/functions … … 504 500 505 501 # End /etc/init.d/functions 506 <userinput>EOF</userinput> 507 </screen> 508 </para> 502 <userinput>EOF</userinput></screen></para> 509 503 510 504 </sect1> -
chapter07/halt.xml
r46f5461 rb822811 2 2 <title>Creating the halt script</title> 3 3 4 <para> 5 Create the <filename>/etc/init.d/halt</filename> script by running the 6 following command: 7 </para> 4 <para>Create the <filename>/etc/init.d/halt</filename> script by running the 5 following command:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cat > halt << "EOF"</userinput> 7 <para><screen><userinput>cat > halt << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/halt … … 20 16 21 17 # End /etc/init.d/halt 22 <userinput>EOF</userinput> 23 </screen> 24 </para> 18 <userinput>EOF</userinput></screen></para> 25 19 26 20 </sect1> -
chapter07/hosts.xml
r46f5461 rb822811 2 2 <title>Creating the /etc/hosts file</title> 3 3 4 <para> 5 If a network card is to be configured, a user has to decide on the 4 <para>If a network card is to be configured, a user has to decide on the 6 5 IP-address, FQDN and possible aliases for use in the /etc/hosts file. An 7 example is: 8 </para> 6 example is:</para> 9 7 10 <para> 11 <screen> 12 <my-IP> myhost.mydomain.org aliases 13 </screen> 14 </para> 8 <para><screen><my-IP> myhost.mydomain.org aliases</screen></para> 15 9 16 <para> 17 It should made sure that the IP-address is in the private network 18 IP-address range. Valid ranges are: 19 </para> 10 <para>It should made sure that the IP-address is in the private network 11 IP-address range. Valid ranges are:</para> 20 12 21 <para> 22 <screen> 23 Class Networks 13 <para><screen> Class Networks 24 14 A 10.0.0.0 25 15 B 172.16.0.0 through 172.31.0.0 26 C 192.168.0.0 through 192.168.255.0 27 </screen> 28 </para> 16 C 192.168.0.0 through 192.168.255.0</screen></para> 29 17 30 <para> 31 A valid IP address could be 192.168.1.1. A valid FQDN for this IP could 32 be www.linuxfromscratch.org 33 </para> 18 <para>A valid IP address could be 192.168.1.1. A valid FQDN for this IP could 19 be www.linuxfromscratch.org</para> 34 20 35 <para> 36 If a user is not going to use a network card, he still needs to come up with a 37 FQDN. This is necessary for programs like Sendmail to operate correctly (in 38 fact; Sendmail won't run when it can't determine the FQDN). 39 </para> 21 <para>If a user is not going to use a network card, he still needs to 22 come up with a FQDN. This is necessary for programs like Sendmail to operate 23 correctly (in fact; Sendmail won't run when it can't determine the FQDN).</para> 40 24 41 <para> 42 If a network card is not going to be configured, a new file 43 <filename>/etc/hosts</filename> is created by running: 44 </para> 25 <para>If a network card is not going to be configured, a new file 26 <filename>/etc/hosts</filename> is created by running:</para> 45 27 46 <para> 47 <screen> 48 <userinput>cat > /etc/hosts << "EOF"</userinput> 28 <para><screen><userinput>cat > /etc/hosts << "EOF"</userinput> 49 29 # Begin /etc/hosts (no network card version) 50 30 … … 52 32 53 33 # End /etc/hosts (no network card version) 54 <userinput>EOF</userinput> 55 </screen> 56 </para> 34 <userinput>EOF</userinput></screen></para> 57 35 58 <para> 59 If a network card is to be configured, a new file 60 <filename>/etc/hosts</filename> is created by running: 61 </para> 36 <para>If a network card is to be configured, a new file 37 <filename>/etc/hosts</filename> is created by running:</para> 62 38 63 <para> 64 <screen> 65 <userinput>cat > /etc/hosts << "EOF"</userinput> 39 <para><screen><userinput>cat > /etc/hosts << "EOF"</userinput> 66 40 # Begin /etc/hosts (network card version) 67 41 … … 70 44 71 45 # End /etc/hosts (network card version) 72 <userinput>EOF</userinput> 73 </screen> 74 </para> 46 <userinput>EOF</userinput></screen></para> 75 47 76 <para> 77 Of course, the 192.168.1.1 and www.mydomain.org have to be changed to the 48 <para>Of course, the 192.168.1.1 and www.mydomain.org have to be changed to the 78 49 users 79 50 liking (or requirements if assigned an IP-address by a network/system 80 administrator and this machine is planned to be connected to that network).81 </para>51 administrator and this machine is planned to be 52 connected to that network).</para> 82 53 83 54 </sect1> -
chapter07/introduction.xml
r46f5461 rb822811 2 2 <title>Introduction</title> 3 3 4 <para> 5 This chapter will create the necessary scripts that are run at boot time. 4 <para>This chapter will create the necessary scripts that are run at boot time. 6 5 These scripts perform tasks such as remounting the root file system 7 6 mounted read-only by the kernel into read-write mode, activating the swap 8 7 partition(s), running a check on the root file system to make sure it's 9 intact, setting up networking and starting the daemons that the system uses.10 </para>8 intact, setting up networking and starting the daemons that the 9 system uses.</para> 11 10 12 <para> 13 We will be using SysV style init scripts. We have chosen this style because it 14 is widely used and we feel confortable with it. If you want to try something 15 else, someone has written an LFS-Hint on BSD style init scripts at <ulink 16 url="http://archive.linuxfromscratch.org/lfs-hints/bsd-init.txt"> 17 http://archive.linuxfromscratch.org/lfs-hints/bsd-init.txt</ulink>. 18 </para> 11 <para>We will be using SysV style init scripts. We have chosen this style 12 because it is widely used and we feel confortable with it. If you want to 13 try something else, someone has written an LFS-Hint on BSD style init scripts 14 at <ulink 15 url="http://archive.linuxfromscratch.org/lfs-hints/bsd-init.txt">http://archive.linuxfromscratch.org/lfs-hints/bsd-init.txt</ulink> 16 .</para> 19 17 20 18 </sect1> -
chapter07/loadkeys.xml
r46f5461 rb822811 2 2 <title>Creating the loadkeys script</title> 3 3 4 <para> 5 A user only needs to create this script if he don't have a default 101 keys 6 US keyboard layout. Create the 4 <para>A user only needs to create this script if he don't have a 5 default 101 keys US keyboard layout. Create the 7 6 <filename>/etc/init.d/loadkeys</filename> script by running the 8 following command: 9 </para> 7 following command:</para> 10 8 11 <para> 12 <screen> 13 <userinput>cat > loadkeys << "EOF"</userinput> 9 <para><screen><userinput>cat > loadkeys << "EOF"</userinput> 14 10 #!/bin/sh 15 11 # Begin /etc/init.d/loadkeys … … 30 26 31 27 # End /etc/init.d/loadkeys 32 <userinput>EOF</userinput> 33 </screen> 34 </para> 28 <userinput>EOF</userinput></screen></para> 35 29 36 30 </sect1> -
chapter07/localnet.xml
r46f5461 rb822811 2 2 <title>Creating the /etc/init.d/localnet boot script</title> 3 3 4 <para> 5 Create the <filename>/etc/init.d/localnet</filename> script by running 6 the following command: 7 </para> 4 <para>Create the <filename>/etc/init.d/localnet</filename> script by running 5 the following command:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cat > /etc/init.d/localnet << "EOF"</userinput> 7 <para><screen><userinput>cat > /etc/init.d/localnet << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/localnet … … 50 46 51 47 # End /etc/init.d/localnet 52 <userinput>EOF</userinput> 53 </screen> 54 </para> 48 <userinput>EOF</userinput></screen></para> 55 49 56 50 </sect1> -
chapter07/mountfs.xml
r46f5461 rb822811 2 2 <title>Creating the mountfs script</title> 3 3 4 <para> 5 Create the <filename>/etc/init.d/mountfs</filename> script by running 6 the following command: 7 </para> 4 <para>Create the <filename>/etc/init.d/mountfs</filename> script by running 5 the following command:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cat > mountfs << "EOF"</userinput> 7 <para><screen><userinput>cat > mountfs << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/mountfs … … 44 40 # 45 41 46 echo >/etc/mtab42 echo > /etc/mtab 47 43 /bin/mount -f -o remount,rw / 48 44 … … 103 99 104 100 # End /etc/init.d/mountfs 105 <userinput>EOF</userinput> 106 </screen> 107 </para> 101 <userinput>EOF</userinput></screen></para> 108 102 109 103 </sect1> -
chapter07/network.xml
r46f5461 rb822811 2 2 <title>Creating the /etc/sysconfig/network file</title> 3 3 4 <para> 5 A new file <filename>/etc/sysconfig/network</filename> is created and the 6 hostname is put in it by running: 7 </para> 4 <para>A new file <filename>/etc/sysconfig/network</filename> is created and the 5 hostname is put in it by running:</para> 8 6 9 <para> 10 <screen> 11 <userinput>echo "HOSTNAME=lfs" > /etc/sysconfig/network</userinput> 12 </screen> 13 </para> 7 <para><screen><userinput>echo "HOSTNAME=lfs" > 8 /etc/sysconfig/network</userinput></screen></para> 14 9 15 <para> 16 <quote>lfs</quote> needs to be replaced by the name the computer is to be 17 called. 18 A user should not enter the FQDN (Fully Qualified Domain 10 <para><quote>lfs</quote> needs to be replaced by the name the computer is 11 to be called. A user should not enter the FQDN (Fully Qualified Domain 19 12 Name) here. That information will be put in the 20 <filename>/etc/hosts</filename> file later. 21 </para> 13 <filename>/etc/hosts</filename> file later.</para> 22 14 23 15 </sect1> -
chapter07/rc.xml
r46f5461 rb822811 2 2 <title>Creating the rc script</title> 3 3 4 <para> 5 The first main boot script is the <filename>/etc/init.d/rc</filename> script. 6 Create the <filename>/etc/init.d/rc</filename> script by running the 7 following command: 8 </para> 9 10 <para> 11 <screen> 12 <userinput>cat > rc << "EOF"</userinput> 4 <para>The first main boot script is the <filename>/etc/init.d/rc</filename> 5 script. Create the <filename>/etc/init.d/rc</filename> script by running the 6 following command:</para> 7 8 <para><screen><userinput>cat > rc << "EOF"</userinput> 13 9 #!/bin/sh 14 10 # Begin /etc/init.d/rc … … 247 243 248 244 # End /etc/init.d/rc 249 <userinput>EOF</userinput> 250 </screen> 251 </para> 245 <userinput>EOF</userinput></screen></para> 252 246 253 247 </sect1> -
chapter07/rcS.xml
r46f5461 rb822811 2 2 <title>Creating the rcS script</title> 3 3 4 <para> 5 The second main boot script is the <filename>rcS</filename> script. Create 6 the <filename>/etc/init.d/rcS</filename> script by running the following 7 command: 8 </para> 4 <para>The second main boot script is the <filename>rcS</filename> script. 5 Create the <filename>/etc/init.d/rcS</filename> script by running the following 6 command:</para> 9 7 10 <para> 11 <screen> 12 <userinput>cat > rcS << "EOF"</userinput> 8 <para><screen><userinput>cat > rcS << "EOF"</userinput> 13 9 #!/bin/sh 14 10 # Begin /etc/init.d/rcS … … 37 33 38 34 # End /etc/init.d/rcS 39 <userinput>EOF</userinput> 40 </screen> 41 </para> 35 <userinput>EOF</userinput></screen></para> 42 36 43 37 </sect1> -
chapter07/reboot.xml
r46f5461 rb822811 2 2 <title>Creating the reboot script</title> 3 3 4 <para> 5 Create the <filename>/etc/init.d/reboot</filename> script by running the 6 following command: 7 </para> 4 <para>Create the <filename>/etc/init.d/reboot</filename> script by running the 5 following command:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cat > reboot << "EOF"</userinput> 7 <para><screen><userinput>cat > reboot << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/reboot … … 23 19 24 20 # End /etc/init.d/reboot 25 <userinput>EOF</userinput> 26 </screen> 27 </para> 21 <userinput>EOF</userinput></screen></para> 28 22 29 23 </sect1> -
chapter07/sendsignals.xml
r46f5461 rb822811 2 2 <title>Creating the sendsignals script</title> 3 3 4 <para> 5 Creat the <filename>/etc/init.d/sendsignals</filename> script by running 6 the following command: 7 </para> 4 <para>Creat the <filename>/etc/init.d/sendsignals</filename> script by running 5 the following command:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cat > sendsignals << "EOF"</userinput> 7 <para><screen><userinput>cat > sendsignals << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/sendsignals … … 37 33 38 34 # End /etc/init.d/sendsignals 39 <userinput>EOF</userinput> 40 </screen> 41 </para> 35 <userinput>EOF</userinput></screen></para> 42 36 43 37 </sect1> -
chapter07/setclock.xml
r46f5461 rb822811 2 2 <title>Creating the setclock script</title> 3 3 4 <para> 5 The following script is only for real use when the hardware clock (also 4 <para>The following script is only for real use when the hardware clock (also 6 5 known as BIOS or CMOS clock) isn't set to GMT time. The recommended 7 6 setup is setting the hardware clock to GMT and having the time converted … … 11 10 the time is properly displayed on those OS'es. This script will reset 12 11 the kernel time to the hardware clock without converting the time using 13 the /etc/localtime symlink. 14 </para> 12 the /etc/localtime symlink.</para> 15 13 16 <para> 17 If you want to use this script on your system even if the 14 <para>If you want to use this script on your system even if the 18 15 hardware clock is set to GMT, then the UTC variable below has to be 19 changed to the value of <emphasis>1</emphasis>. 20 </para> 16 changed to the value of <emphasis>1</emphasis>.</para> 21 17 22 <para> 23 Creat the <filename>/etc/init.d/setclock</filename> script by running 24 the following command: 25 </para> 18 <para>Create the <filename>/etc/init.d/setclock</filename> script by running 19 the following command:</para> 26 20 27 <para> 28 <screen> 29 <userinput>cat > setclock << "EOF"</userinput> 21 <para><screen><userinput>cat > setclock << "EOF"</userinput> 30 22 #!/bin/sh 31 23 # Begin /etc/init.d/setclock … … 66 58 67 59 # End /etc/init.d/setclock 68 <userinput>EOF</userinput> 69 </screen> 70 </para> 60 <userinput>EOF</userinput></screen></para> 71 61 72 62 <sect2> 73 63 <title>Creating the /etc/sysconfig/clock file</title> 74 64 75 <para> 76 Create a new file <filename>/etc/sysconfig/clock</filename> by running 77 the following: 78 </para> 65 <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running 66 the following:</para> 79 67 80 <para> 81 <screen> 82 <userinput>cat > /etc/sysconfig/clock << "EOF"</userinput> 68 <para><screen><userinput>cat > /etc/sysconfig/clock << "EOF"</userinput> 83 69 # Begin /etc/sysconfig/clock 84 70 … … 86 72 87 73 # End /etc/sysconfig/clock 88 <userinput>EOF</userinput> 89 </screen> 90 </para> 74 <userinput>EOF</userinput></screen></para> 91 75 92 <para> 93 If the hardware clock (also known as BIOS or CMOS clock) is not set to 76 <para>If the hardware clock (also known as BIOS or CMOS clock) is not set to 94 77 GMT time, then the UTC variable in the /etc/sysconfig/clock file needs to be 95 set to 96 the value <emphasis>0</emphasis> (zero). 97 </para> 78 set to the value <emphasis>0</emphasis> (zero).</para> 98 79 99 <para> 100 Now, you may want to take a look at a very good hint explaining how we 101 deal with time on LFS at 102 <ulink url="http://archive.linuxfromscratch.org/lfs-hints/time.txt"> 103 http://archive.linuxfromscratch.org/lfs-hints/time.txt</ulink>. 104 It explains issues such as timezones, UTC, and the TZ 105 environment variable. 106 </para> 80 <para>Now, you may want to take a look at a very good hint explaining how we 81 deal with time on LFS at <ulink 82 url="http://archive.linuxfromscratch.org/lfs-hints/time.txt">http://archive.linuxfromscratch.org/lfs-hints/time.txt</ulink>. 83 It explains issues such as timezones, UTC, and the TZ 84 environment variable.</para> 107 85 108 86 </sect2> -
chapter07/symperm.xml
r46f5461 rb822811 2 2 <title>Setting up symlinks and permissions</title> 3 3 4 <para> 5 These files get the proper permissions and the necessary symlinks are created 6 by running the following commands. If you didn't create the loadkeys 7 and setclock scripts, make sure not to type them in the commands below. 8 </para> 4 <para>These files get the proper permissions and the necessary symlinks 5 are created by running the following commands. If you didn't create the loadkeys 6 and setclock scripts, make sure not to type them in the commands below.</para> 9 7 10 <para> 11 A note of caution: all the symlinks (that start with an S or K) have to 8 <para>A note of caution: all the symlinks (that start with an S or K) have to 12 9 be of the form Sxxxname where xxx are three digits donating the order in 13 10 which the script is executed (the lower the number the sooner it's … … 15 12 you pad with extra zero's at the beginning. This means, don't use 16 13 S20mydaemon, but S020mydaemon. And don't use K2otherdaemon, but 17 K002otherdaemon. 18 </para> 14 K002otherdaemon.</para> 19 15 20 <para> 21 <screen> 22 <userinput>cd /etc/init.d &&</userinput> 16 <para><screen><userinput>cd /etc/init.d &&</userinput> 23 17 <userinput>chmod 754 rc rcS functions checkfs halt loadkeys mountfs reboot &&</userinput> 24 18 <userinput>chmod 754 sendsignals setclock sysklogd template &&</userinput> … … 56 50 <userinput>cd ../rc5.d &&</userinput> 57 51 <userinput>ln -s ../init.d/sysklogd S100sysklogd &&</userinput> 58 <userinput>ln -s ../init.d/ethnet S200ethnet</userinput> 59 </screen> 60 </para> 52 <userinput>ln -s ../init.d/ethnet S200ethnet</userinput></screen></para> 61 53 62 54 </sect1> -
chapter07/sysklogd.xml
r46f5461 rb822811 2 2 <title>Creating the sysklogd script</title> 3 3 4 <para> 5 Create the <filename>/etc/init.d/sysklogd</filename> script by running 6 the following command: 7 </para> 4 <para>Create the <filename>/etc/init.d/sysklogd</filename> script by running 5 the following command:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cat > sysklogd << "EOF"</userinput> 7 <para><screen><userinput>cat > sysklogd << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/sysklogd … … 60 56 61 57 # End /etc/init.d/sysklogd 62 <userinput>EOF</userinput> 63 </screen> 64 </para> 58 <userinput>EOF</userinput></screen></para> 65 59 66 60 </sect1> -
chapter07/template.xml
r46f5461 rb822811 2 2 <title>Creating the template script</title> 3 3 4 <para> 5 Create the <filename>/etc/init.d/template</filename> script by running 6 the following command: 7 </para> 4 <para>Create the <filename>/etc/init.d/template</filename> script by running 5 the following command:</para> 8 6 9 <para> 10 <screen> 11 <userinput>cat > template << "EOF"</userinput> 7 <para><screen><userinput>cat > template << "EOF"</userinput> 12 8 #!/bin/sh 13 9 # Begin /etc/init.d/ … … 53 49 54 50 # End /etc/init.d/ 55 <userinput>EOF</userinput> 56 </screen> 57 </para> 51 <userinput>EOF</userinput></screen></para> 58 52 59 53 </sect1> -
chapter07/usage.xml
r46f5461 rb822811 2 2 <title>How does the booting process with these scripts work?</title> 3 3 4 <para> 5 Linux uses a special booting facility named SysVinit. It's based on a 4 <para>Linux uses a special booting facility named SysVinit. It's based on a 6 5 concept of <emphasis>runlevels</emphasis>. It can be widely different 7 6 from one system to another, so it can not be assumed that because things 8 7 worked in <insert distro name> they should work like that in LFS 9 8 too. LFS has it's own way of doing things, but it respects generally 10 accepted standards. 11 </para> 9 accepted standards.</para> 12 10 13 <para> 14 SysVinit (which we'll call <emphasis>init</emphasis> from now on) works 11 <para>SysVinit (which we'll call <emphasis>init</emphasis> from now on) works 15 12 using a runlevels scheme. There are 7 (from 0 to 6) runlevels 16 13 (actually, there are more runlevels but they are for special cases and … … 18 15 one of those corresponds to the things the computer is supposed to do when 19 16 it starts up. The default runlevel is 3. Here are the descriptions of the 20 different runlevels as they are often implemented: 21 </para> 17 different runlevels as they are often implemented:</para> 22 18 23 <literallayout> 24 0: halt the computer 19 <literallayout>0: halt the computer 25 20 1: single-user mode 26 21 2: multi-user mode without networking … … 28 23 4: reserved for customization, otherwise does the same as 3 29 24 5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm) 30 6: reboot the computer 31 </literallayout> 25 6: reboot the computer</literallayout> 32 26 33 <para> 34 The command used to change runlevels is <userinput>init 27 <para>The command used to change runlevels is <userinput>init 35 28 <runlevel></userinput> where <runlevel> is 36 29 the target runlevel. For example, to reboot the computer, a user would issue 37 30 the init 6 command. The reboot command is just an alias, as is the halt 38 command an alias to init 0. 39 </para> 31 command an alias to init 0.</para> 40 32 41 <para> 42 The /etc/init.d/rcS script is run at every startup of the computer, 33 <para>The /etc/init.d/rcS script is run at every startup of the computer, 43 34 before any runlevel is executed and runs the scripts listed in 44 /etc/rcS.d 45 </para> 35 /etc/rcS.d</para> 46 36 47 <para> 48 There are a number of directories under /etc that look like like rc?.d 37 <para>There are a number of directories under /etc that look like like rc?.d 49 38 where ? is the number of the runlevel and rcS.d. A user might take a look 50 39 at one of … … 56 45 are run, from 000 to 999; the lower the number the sooner it gets 57 46 executed. When init switches to another runlevel, the appropriate 58 services get killed and others get started. 59 </para> 47 services get killed and others get started.</para> 60 48 61 <para> 62 The real scripts are in /etc/init.d. They do all the work, and the 49 <para>The real scripts are in /etc/init.d. They do all the work, and the 63 50 symlinks all point to them. Killing links and starting 64 51 links point to the same script in /etc/init.d. That's because the scripts … … 66 53 status. When a K link is encountered, the appropriate script is run with 67 54 the stop argument. When a S link is encountered, the appropriate script 68 is run with the start argument. 69 </para> 55 is run with the start argument.</para> 70 56 71 <para> 72 These are descriptions of what the arguments make the scripts do: 73 </para> 57 <para>These are descriptions of what the arguments make the 58 scripts do:</para> 74 59 75 60 <itemizedlist> 76 61 77 <listitem><para> 78 <emphasis>start</emphasis>: The service is started. 79 </para></listitem> 62 <listitem><para><emphasis>start</emphasis>: The service is 63 started.</para></listitem> 80 64 81 <listitem><para> 82 <emphasis>stop</emphasis>: The service is stopped. 83 </para></listitem> 65 <listitem><para><emphasis>stop</emphasis>: The service is 66 stopped.</para></listitem> 84 67 85 <listitem><para> 86 <emphasis>restart</emphasis>: The service is stopped and then started again. 87 </para></listitem> 68 <listitem><para><emphasis>restart</emphasis>: The service is 69 stopped and then started again.</para></listitem> 88 70 89 <listitem><para> 90 <emphasis>reload</emphasis>: The configurationof the service is updated.71 <listitem><para><emphasis>reload</emphasis>: The configuration 72 of the service is updated. 91 73 This is used after the configuration file of a service was modified, when 92 the service doesn't need to be restarted. 93 </para></listitem> 74 the service doesn't need to be restarted.</para></listitem> 94 75 95 <listitem><para> 96 <emphasis>status</emphasis>: Tells if the service is running and with 97 which PID's. 98 </para></listitem> 76 <listitem><para><emphasis>status</emphasis>: Tells if the service 77 is running and with which PID's.</para></listitem> 99 78 100 79 </itemizedlist> 101 80 102 <para> 103 Feel free to modify the way the boot process works (after all it's your 81 <para>Feel free to modify the way the boot process works (after all it's your 104 82 LFS system, not ours). The files here are just an example of how it can be 105 done in a nice way (well what we consider nice anyway. You may hate it). 106 </para> 83 done in a nice way (well what we consider nice anyway. You may hate it).</para> 107 84 108 85 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.