website diff pt/doc/scratchbook/boot-scripts.html @ rev 267

pt: add scratchbook english pages for future translation
author Claudinei Pereira <claudinei@ensinoemrede.com>
date Fri Jan 30 18:32:32 2009 +0000 (2009-01-30)
parents
children c6b2d9c4e031
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pt/doc/scratchbook/boot-scripts.html	Fri Jan 30 18:32:32 2009 +0000
     1.3 @@ -0,0 +1,207 @@
     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 Scratchbook - Boot Scripts</title>
     1.9 +    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    1.10 +    <meta name="description" content="" />
    1.11 +    <meta name="expires" content="never" />
    1.12 +    <meta name="modified" content="2008-11-22 17:00: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="locale.html">Locale &amp; i18n</a> |
    1.25 +    <a href="index.html">Table of contents</a> |
    1.26 +    <a href="x-window-system.html">X window system</a>
    1.27 +</div>
    1.28 +<h1><font color="#3E1220">SliTaz Scratchbook</font></h1>
    1.29 +</div>
    1.30 +
    1.31 +<!-- Content. -->
    1.32 +<div id="content">
    1.33 +<div class="content-right"></div>
    1.34 +
    1.35 +<h2><font color="#df8f06">Boot scripts</font></h2>
    1.36 +<p>
    1.37 +The startup and shutdown scripts with their configuration files.
    1.38 +</p>
    1.39 +
    1.40 +<ul>
    1.41 +  	<li><a href="#intro">SliTaz and startup.</a></li>
    1.42 +	<li><a href="#init.d">/etc/init.d/*</a> - Directory of scripts and daemons.</li>
    1.43 +	<li><a href="#rcS">/etc/init.d/rcS</a> - Primary initialization script.</li>
    1.44 +	<li><a href="#rc-scripts">Specific scripts and daemons</a> - Scripts and
    1.45 +	daemons with a very specific task.</li>
    1.46 +	<li><a href="#inittab">/etc/inittab</a> - Configuration file init.</li>
    1.47 +</ul>
    1.48 +
    1.49 +<a name="intro"></a>
    1.50 +<h3><font color="#6c0023">SliTaz and startup</font></h3>
    1.51 +
    1.52 +<p>
    1.53 +SliTaz does not use a level of execution (runlevel), the
    1.54 +system is initialized via a primary script and its main 
    1.55 +configuration file. This script itself launches some other smaller 
    1.56 +scripts which deal with the internationalization or the
    1.57 +commands placed for the system to start.
    1.58 +</p>
    1.59 +
    1.60 +<a name="init.d"></a>
    1.61 +<h3><font color="#6c0023">/etc/init.d/* - Directory of scripts and daemons</font></h3>
    1.62 +<p>
    1.63 +The directory /etc/init.d contains all of the rc scripts,
    1.64 +scripts finishing with '.sh' are simple shell scripts and
    1.65 +daemons such as 'dropbear' or 'lighttpd' are scripts
    1.66 +that launch a service. The daemon scripts can start, stop or
    1.67 +restart through the command:
    1.68 +</p>
    1.69 +<pre> # /etc/init.d/daemon [start|stop|restart]
    1.70 +</pre>
    1.71 +<p>
    1.72 +On SliTaz you will find a /etc/init.d/README describing the
    1.73 +basic function of rc scripts. Also note that all startup
    1.74 +scripts and daemons can call upon the <code>/etc/init.d/rc.functions</code>
    1.75 +file. This file makes it possible to include various functions
    1.76 +in rc scripts. SliTaz uses a function <code>status</code> to check whether
    1.77 +the previous command has succeeded (0) or not.
    1.78 +</p>
    1.79 +
    1.80 +<a name="rcS"></a>
    1.81 +<h3><font color="#6c0023">/etc/init.d/rcS - Primary initialization script</font></h3>
    1.82 +<p>
    1.83 +The <code>/etc/init.d/rcS</code> script configures all the 
    1.84 +basic services and initializes the base system. It begins by 
    1.85 +mounting the filesystems and starts services like syslogd, klogd,
    1.86 +mdev and cleans up the system and so on. It
    1.87 +uses the configuration file <code>/etc/rcS.conf</code> to locate which daemons
    1.88 +and scripts to launch at startup. You can browse the script
    1.89 +to know which commands are executed:
    1.90 +</p>
    1.91 +<pre> # nano rootfs/etc/init.d/rcS 
    1.92 +</pre>
    1.93 +
    1.94 +
    1.95 +<a name="rc-scripts"></a>
    1.96 +<h3><font color="#6c0023">Specific scripts and daemons</font></h3>
    1.97 +
    1.98 +<h4>bootopts.sh - LiveCD mode options</h4>
    1.99 +<p>
   1.100 +This script is used to configure the LiveCD options passed
   1.101 +at boot time and is readable via the /proc/cmdline file. 
   1.102 +This is the script that allows you to use a USB key or 
   1.103 +external hard disk <code>/home</code>  partition with the option home=usb
   1.104 +or home=sda[1-9] or directly specify the language and 
   1.105 +keyboard parameters.
   1.106 +</p>
   1.107 +
   1.108 +<h4>network.sh - Initializing the network</h4>
   1.109 +<p>
   1.110 +This script searches the network.sh configuration file 
   1.111 +/etc/network.conf for the network interface to use; if one wants to
   1.112 +launch the DHCP client (or not) or if you want to use a fixed 
   1.113 +(static) IP. On SliTaz the /etc/init.d/network.sh 
   1.114 +script configures the network interfaces to start using the 
   1.115 +information contained in /etc/network.conf. If the variable 
   1.116 +$DHCP is equal to yes, then the /etc/init.d/network.sh 
   1.117 +script launches the DHCP client on the $INTERFACE interface.
   1.118 +</p>
   1.119 +
   1.120 +<h4>i18n.sh - Internationalization</h4>
   1.121 +<p>
   1.122 +SliTaz backs up the configuration of the default locale in
   1.123 +/etc/locale.conf which is read by /etc/profile at each 
   1.124 +login. The /etc/locale.conf is generated during boot time
   1.125 +thanks to the /etc/i18n.sh script. This script launches the
   1.126 +'tazlocale' application if /etc/locale.conf doesn't exist. 
   1.127 +We use the same process for the keyboard layout using 'tazkmap' 
   1.128 +and the /etc/kmap.conf configuration file. Both applications 
   1.129 +are installed and located in /sbin and use dialog and the 
   1.130 +ncurses library. The script also checks whether the 
   1.131 +configuration file for the time zone /etc/TZ exists, 
   1.132 +otherwise it creates one relying on the keyboard configuration.
   1.133 +</p>
   1.134 +
   1.135 +<h4>local.sh - Local commands</h4>
   1.136 +<p>
   1.137 +The /etc/init.d/local.sh script allows the system administrator
   1.138 +to add local commands to be executed at boot. Example:
   1.139 +</p>
   1.140 +<pre class="script">#!/bin/sh
   1.141 +# /etc/init.d/local.sh: Local startup commands.
   1.142 +# All commands here will be executed at boot time.
   1.143 +#
   1.144 +. /etc/init.d/rc.functions
   1.145 +
   1.146 +echo "Starting local startup commands... "
   1.147 +
   1.148 +</pre>
   1.149 +
   1.150 +<h4>rc.shutdown</h4>
   1.151 +<p>
   1.152 +This script is invoked by /etc/inittab during system shutdown.
   1.153 +It also stops all daemons via the variable RUN_DAEMONS in 
   1.154 +the primary <code>/etc/rcS.conf</code> configuration file.
   1.155 +</p>
   1.156 +
   1.157 +<a name="inittab"></a>
   1.158 +<h3><font color="#6c0023">/etc/inittab - Configuration file init</font></h3>
   1.159 +<p>
   1.160 +The first file read by the Kernel at boot. It defines the 
   1.161 +initialization script (/etc/init.d/rcS), shells (ttys) and
   1.162 +actions in the event of a reboot or disruption. You will find
   1.163 +a complete example with accompanying notes in <a href="http://www.slitaz.org/en/doc/cookbook/slitaz-tools.html">SliTaz tools</a>:
   1.164 +</p>
   1.165 +<pre class="script"># /etc/inittab: init configuration for SliTaz GNU/Linux.
   1.166 +# Boot-time system configuration/initialization script.
   1.167 +#
   1.168 +::sysinit:/etc/init.d/rcS
   1.169 +
   1.170 +# /sbin/getty respawn shell invocations for selected ttys.
   1.171 +tty1::respawn:/sbin/getty 38400 tty1
   1.172 +tty2::respawn:/sbin/getty 38400 tty2
   1.173 +tty3::respawn:/sbin/getty 38400 tty3
   1.174 +tty4::respawn:/sbin/getty 38400 tty4
   1.175 +tty5::respawn:/sbin/getty 38400 tty5
   1.176 +tty6::respawn:/sbin/getty 38400 tty6
   1.177 +
   1.178 +# Stuff to do when restarting the init 
   1.179 +# process, or before rebooting.
   1.180 +::restart:/etc/init.d/rc.shutdown
   1.181 +::restart:/sbin/init
   1.182 +::ctrlaltdel:/sbin/reboot
   1.183 +::shutdown:/etc/init.d/rc.shutdown
   1.184 +
   1.185 +</pre>
   1.186 +<h4>Following chapter</h4>
   1.187 +<p>
   1.188 +The next chapter continues on with the <a href="x-window-system.html">X window system</a>.
   1.189 +</p>
   1.190 +
   1.191 +<!-- End of content -->
   1.192 +</div>
   1.193 +
   1.194 +<!-- Footer. -->
   1.195 +<div id="footer">
   1.196 +	<div class="footer-right"></div>
   1.197 +	<a href="#top">Top of the page</a> | 
   1.198 +	<a href="index.html">Table of contents</a>
   1.199 +</div>
   1.200 +
   1.201 +<div id="copy">
   1.202 +    Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
   1.203 +    <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
   1.204 +    Documentation is under
   1.205 +    <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
   1.206 +    and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
   1.207 +</div>
   1.208 +
   1.209 +</body>
   1.210 +</html>