website rev 140
en: Add Boot Scripts to Ckbk
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Thu Aug 21 22:19:36 2008 +0000 (2008-08-21) |
parents | 945470ee2725 |
children | 5da56ed9969b |
files | en/doc/cookbook/boot-scripts.html en/doc/cookbook/index.html en/doc/cookbook/slitaz-tools.html |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/en/doc/cookbook/boot-scripts.html Thu Aug 21 22:19:36 2008 +0000 1.3 @@ -0,0 +1,203 @@ 1.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 1.5 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 1.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 1.7 +<head> 1.8 + <title>SliTaz Cookbook (en) - Boot Scripts</title> 1.9 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 1.10 + <meta name="description" content="slitaz English cookbook" /> 1.11 + <meta name="expires" content="never" /> 1.12 + <meta name="modified" content="2008-02-26 18:30:00" /> 1.13 + <meta name="publisher" content="www.slitaz.org" /> 1.14 + <meta name="author" content="Christophe Lincoln"/> 1.15 + <link rel="shortcut icon" href="favicon.ico" /> 1.16 + <link rel="stylesheet" type="text/css" href="book.css" /> 1.17 +</head> 1.18 +<body bgcolor="#ffffff"> 1.19 + 1.20 +<!-- Header and quick navigation --> 1.21 +<div id="header"> 1.22 +<div align="right" id="quicknav"> 1.23 + <a name="top"></a> 1.24 + <a href="slitaz-tools.html">SliTaz Tools</a> | 1.25 + <a href="index.html">Table of contents</a> 1.26 +</div> 1.27 +<h1><font color="#3E1220">SliTaz Cookbook (en)</font></h1> 1.28 +</div> 1.29 + 1.30 +<!-- Content. --> 1.31 +<div id="content"> 1.32 +<div class="content-right"></div> 1.33 + 1.34 +<h2><font color="#df8f06">Boot scripts</font></h2> 1.35 +<p> 1.36 +The startup and shutdown scripts with their configuration files. 1.37 +</p> 1.38 + 1.39 +<ul> 1.40 + <li><a href="#intro">SliTaz and startup.</a></li> 1.41 + <li><a href="#init.d">/etc/init.d/*</a> - Directory of scripts and daemons.</li> 1.42 + <li><a href="#rcS">/etc/init.d/rcS</a> - Primary initialization script.</li> 1.43 + <li><a href="#rc-scripts">Specific scripts and daemons</a> - Scripts and 1.44 + daemons with a very specific task.</li> 1.45 + <li><a href="#inittab">/etc/inittab</a> - Configuration file init.</li> 1.46 +</ul> 1.47 + 1.48 +<a name="intro"></a> 1.49 +<h3><font color="#6c0023">SliTaz and startup</font></h3> 1.50 + 1.51 +<p> 1.52 +SliTaz does not use a level of execution (runlevel), the 1.53 +system is initialized via a primary script and its main 1.54 +configuration file. This script itself launches some other smaller 1.55 +scripts which deal with the internationalization or the 1.56 +commands placed for the system to start. 1.57 +</p> 1.58 + 1.59 +<a name="init.d"></a> 1.60 +<h3><font color="#6c0023">/etc/init.d/* - Directory of scripts and daemons</font></h3> 1.61 +<p> 1.62 +The directory /etc/init.d contains all of the rc scripts, 1.63 +scripts finishing with '.sh' are simple shell scripts and 1.64 +daemons such as 'dropbear' or 'lighttpd' are scripts 1.65 +that launch a service. The daemon scripts can start, stop or 1.66 +restart through the command: 1.67 +</p> 1.68 +<pre> # /etc/init.d/daemon [start|stop|restart] 1.69 +</pre> 1.70 +<p> 1.71 +On SliTaz you will find a /etc/init.d/README describing the 1.72 +basic function of rc scripts. Also note that all startup 1.73 +scripts and daemons can call upon the <code>/etc/init.d/rc.functions</code> 1.74 +file. This file makes it possible to include various functions 1.75 +in rc scripts. SliTaz uses a function <code>status</code> to check whether 1.76 +the previous command has succeeded (0) or not. 1.77 +</p> 1.78 + 1.79 +<a name="rcS"></a> 1.80 +<h3><font color="#6c0023">/etc/init.d/rcS - Primary initialization script</font></h3> 1.81 +<p> 1.82 +The <code>/etc/init.d/rcS</code> script configures all the 1.83 +basic services and initializes the base system. It begins by 1.84 +mounting the filesystems and starts services like syslogd, klogd, 1.85 +mdev and cleans up the system and so on. It 1.86 +uses the configuration file <code>/etc/rcS.conf</code> to see which daemons 1.87 +and scripts to launch at startup. You can browse the script 1.88 +to know which commands are executed: 1.89 +</p> 1.90 +<pre> # nano rootfs/etc/init.d/rcS 1.91 +</pre> 1.92 + 1.93 + 1.94 +<a name="rc-scripts"></a> 1.95 +<h3><font color="#6c0023">Specific scripts and daemons</font></h3> 1.96 + 1.97 +<h4>bootopts.sh - LiveCD mode options</h4> 1.98 +<p> 1.99 +This script is used to configure the LiveCD options passed 1.100 +at boot time and is readable via the /proc/cmdline file. 1.101 +This is the script that allows you to use a USB key or 1.102 +external hard disk <code>/home</code> partition with the option home=usb 1.103 +or home=sda[1-9] or directly specify the language and 1.104 +keyboard parameters. 1.105 +</p> 1.106 + 1.107 +<h4>network.sh - Initializing the network</h4> 1.108 +<p> 1.109 +This script searches the network.sh configuration file 1.110 +/etc/network.conf for the network interface to use; if one wants to 1.111 +launch the DHCP client (or not) or if you want to use a fixed 1.112 +(static) IP. On SliTaz the /etc/init.d/network.sh 1.113 +script configures the network interfaces to start using the 1.114 +information contained in /etc/network.conf. If the variable 1.115 +$DHCP is equal to yes, then the /etc/init.d/network.sh 1.116 +script launches the DHCP client on the $INTERFACE interface. 1.117 +</p> 1.118 + 1.119 +<h4>i18n.sh - Internationalization</h4> 1.120 +<p> 1.121 +SliTaz backs up the configuration of the default locale in 1.122 +/etc/locale.conf which is read by /etc/profile at each 1.123 +login. The /etc/locale.conf is generated during boot time 1.124 +thanks to the /etc/i18n.sh script. This script launches the 1.125 +'tazlocale' application if /etc/locale.conf doesn't exist. 1.126 +We use the same process for the keyboard layout using 'tazkmap' 1.127 +and the /etc/kmap.conf configuration file. Both applications 1.128 +are installed and located in /sbin and use dialog and the 1.129 +ncurses library. The script also checks whether the 1.130 +configuration file for the time zone /etc/TZ exists, 1.131 +otherwise it creates one relying on the keyboard configuration. 1.132 +</p> 1.133 + 1.134 +<h4>local.sh - Local commands</h4> 1.135 +<p> 1.136 +The /etc/init.d/local.sh script allows the system administrator 1.137 +to add local commands to be executed at boot. Example: 1.138 +</p> 1.139 +<pre class="script">#!/bin/sh 1.140 +# /etc/init.d/local.sh: Local startup commands. 1.141 +# All commands here will be executed at boot time. 1.142 +# 1.143 +. /etc/init.d/rc.functions 1.144 + 1.145 +echo "Starting local startup commands... " 1.146 + 1.147 +</pre> 1.148 + 1.149 +<h4>rc.shutdown</h4> 1.150 +<p> 1.151 +This script is invoked by /etc/inittab during system shutdown. 1.152 +It also stops all daemons via the variable RUN_DAEMONS in 1.153 +the primary <code>/etc/rcS.conf</code> configuration file. 1.154 +</p> 1.155 + 1.156 +<a name="inittab"></a> 1.157 +<h3><font color="#6c0023">/etc/inittab - Configuration file init</font></h3> 1.158 +<p> 1.159 +The first file read by the Kernel at boot. It defines the 1.160 +initialization script (/etc/init.d/rcS), shells (ttys) and 1.161 +actions in the event of a reboot or disruption. You will find 1.162 +a complete example with accompanying notes in <a href="slitaz-tools.html">SliTaz tools</a>: 1.163 +</p> 1.164 +<pre class="script"># /etc/inittab: init configuration for SliTaz GNU/Linux. 1.165 +# Boot-time system configuration/initialization script. 1.166 +# 1.167 +::sysinit:/etc/init.d/rcS 1.168 + 1.169 +# /sbin/getty respawn shell invocations for selected ttys. 1.170 +tty1::respawn:/sbin/getty 38400 tty1 1.171 +tty2::respawn:/sbin/getty 38400 tty2 1.172 +tty3::respawn:/sbin/getty 38400 tty3 1.173 +tty4::respawn:/sbin/getty 38400 tty4 1.174 +tty5::respawn:/sbin/getty 38400 tty5 1.175 +tty6::respawn:/sbin/getty 38400 tty6 1.176 + 1.177 +# Stuff to do when restarting the init 1.178 +# process, or before rebooting. 1.179 +::restart:/etc/init.d/rc.shutdown 1.180 +::restart:/sbin/init 1.181 +::ctrlaltdel:/sbin/reboot 1.182 +::shutdown:/etc/init.d/rc.shutdown 1.183 + 1.184 +</pre> 1.185 + 1.186 +<!-- End of content --> 1.187 +</div> 1.188 + 1.189 +<!-- Footer. --> 1.190 +<div id="footer"> 1.191 + <div class="footer-right"></div> 1.192 + <a href="#top">Top of the page</a> | 1.193 + <a href="index.html">Table of contents</a> 1.194 +</div> 1.195 + 1.196 +<div id="copy"> 1.197 + Copyright © 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> - 1.198 + <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br /> 1.199 + Documentation is under 1.200 + <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a> 1.201 + and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>. 1.202 +</div> 1.203 + 1.204 +</body> 1.205 +</html> 1.206 +
2.1 --- a/en/doc/cookbook/index.html Tue Aug 19 21:44:00 2008 +0000 2.2 +++ b/en/doc/cookbook/index.html Thu Aug 21 22:19:36 2008 +0000 2.3 @@ -35,7 +35,9 @@ 2.4 <li><a href="wok-tools.html">Wok & Tools.</a> - SliTaz Package Tools.</li> 2.5 <li><a href="receipts.html">Receipts.</a> - Receipts for creating SliTaz packages.</li> 2.6 <li><a href="../manuals/tazwok.en.html">Tazwok manual.</a> - Manual for compiling & generating packages for SliTaz.</li> 2.7 + <li><a href="boot-scripts.html">Boot Scripts</a> - The startup and shutdown scripts.</li> 2.8 <li><a href="slitaz-tools.html">SliTaz Tools</a> - The Toolbox.</li> 2.9 + 2.10 </ul> 2.11 2.12 <h3>About this Cookbook</h3>
3.1 --- a/en/doc/cookbook/slitaz-tools.html Tue Aug 19 21:44:00 2008 +0000 3.2 +++ b/en/doc/cookbook/slitaz-tools.html Thu Aug 21 22:19:36 2008 +0000 3.3 @@ -18,7 +18,6 @@ 3.4 <div id="header"> 3.5 <div align="right" id="quicknav"> 3.6 <a name="top"></a> 3.7 - <a href="http://www.slitaz.org/en/">www.slitaz.org/en</a> | 3.8 <a href="index.html">Table of contents</a> 3.9 </div> 3.10 <h1><font color="#3E1220">SliTaz Cookbook (en)</font></h1>