website annotate 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
rev   line source
claudinei@267 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
claudinei@267 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
claudinei@267 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
claudinei@267 4 <head>
claudinei@267 5 <title>SliTaz Scratchbook - Boot Scripts</title>
claudinei@267 6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
claudinei@267 7 <meta name="description" content="" />
claudinei@267 8 <meta name="expires" content="never" />
claudinei@267 9 <meta name="modified" content="2008-11-22 17:00:00" />
claudinei@267 10 <meta name="publisher" content="www.slitaz.org" />
claudinei@267 11 <meta name="author" content="Christophe Lincoln"/>
claudinei@267 12 <link rel="shortcut icon" href="favicon.ico" />
claudinei@267 13 <link rel="stylesheet" type="text/css" href="book.css" />
claudinei@267 14 </head>
claudinei@267 15 <body bgcolor="#ffffff">
claudinei@267 16
claudinei@267 17 <!-- Header and quick navigation -->
claudinei@267 18 <div id="header">
claudinei@267 19 <div align="right" id="quicknav">
claudinei@267 20 <a name="top"></a>
claudinei@267 21 <a href="locale.html">Locale &amp; i18n</a> |
claudinei@267 22 <a href="index.html">Table of contents</a> |
claudinei@267 23 <a href="x-window-system.html">X window system</a>
claudinei@267 24 </div>
claudinei@267 25 <h1><font color="#3E1220">SliTaz Scratchbook</font></h1>
claudinei@267 26 </div>
claudinei@267 27
claudinei@267 28 <!-- Content. -->
claudinei@267 29 <div id="content">
claudinei@267 30 <div class="content-right"></div>
claudinei@267 31
claudinei@267 32 <h2><font color="#df8f06">Boot scripts</font></h2>
claudinei@267 33 <p>
claudinei@267 34 The startup and shutdown scripts with their configuration files.
claudinei@267 35 </p>
claudinei@267 36
claudinei@267 37 <ul>
claudinei@267 38 <li><a href="#intro">SliTaz and startup.</a></li>
claudinei@267 39 <li><a href="#init.d">/etc/init.d/*</a> - Directory of scripts and daemons.</li>
claudinei@267 40 <li><a href="#rcS">/etc/init.d/rcS</a> - Primary initialization script.</li>
claudinei@267 41 <li><a href="#rc-scripts">Specific scripts and daemons</a> - Scripts and
claudinei@267 42 daemons with a very specific task.</li>
claudinei@267 43 <li><a href="#inittab">/etc/inittab</a> - Configuration file init.</li>
claudinei@267 44 </ul>
claudinei@267 45
claudinei@267 46 <a name="intro"></a>
claudinei@267 47 <h3><font color="#6c0023">SliTaz and startup</font></h3>
claudinei@267 48
claudinei@267 49 <p>
claudinei@267 50 SliTaz does not use a level of execution (runlevel), the
claudinei@267 51 system is initialized via a primary script and its main
claudinei@267 52 configuration file. This script itself launches some other smaller
claudinei@267 53 scripts which deal with the internationalization or the
claudinei@267 54 commands placed for the system to start.
claudinei@267 55 </p>
claudinei@267 56
claudinei@267 57 <a name="init.d"></a>
claudinei@267 58 <h3><font color="#6c0023">/etc/init.d/* - Directory of scripts and daemons</font></h3>
claudinei@267 59 <p>
claudinei@267 60 The directory /etc/init.d contains all of the rc scripts,
claudinei@267 61 scripts finishing with '.sh' are simple shell scripts and
claudinei@267 62 daemons such as 'dropbear' or 'lighttpd' are scripts
claudinei@267 63 that launch a service. The daemon scripts can start, stop or
claudinei@267 64 restart through the command:
claudinei@267 65 </p>
claudinei@267 66 <pre> # /etc/init.d/daemon [start|stop|restart]
claudinei@267 67 </pre>
claudinei@267 68 <p>
claudinei@267 69 On SliTaz you will find a /etc/init.d/README describing the
claudinei@267 70 basic function of rc scripts. Also note that all startup
claudinei@267 71 scripts and daemons can call upon the <code>/etc/init.d/rc.functions</code>
claudinei@267 72 file. This file makes it possible to include various functions
claudinei@267 73 in rc scripts. SliTaz uses a function <code>status</code> to check whether
claudinei@267 74 the previous command has succeeded (0) or not.
claudinei@267 75 </p>
claudinei@267 76
claudinei@267 77 <a name="rcS"></a>
claudinei@267 78 <h3><font color="#6c0023">/etc/init.d/rcS - Primary initialization script</font></h3>
claudinei@267 79 <p>
claudinei@267 80 The <code>/etc/init.d/rcS</code> script configures all the
claudinei@267 81 basic services and initializes the base system. It begins by
claudinei@267 82 mounting the filesystems and starts services like syslogd, klogd,
claudinei@267 83 mdev and cleans up the system and so on. It
claudinei@267 84 uses the configuration file <code>/etc/rcS.conf</code> to locate which daemons
claudinei@267 85 and scripts to launch at startup. You can browse the script
claudinei@267 86 to know which commands are executed:
claudinei@267 87 </p>
claudinei@267 88 <pre> # nano rootfs/etc/init.d/rcS
claudinei@267 89 </pre>
claudinei@267 90
claudinei@267 91
claudinei@267 92 <a name="rc-scripts"></a>
claudinei@267 93 <h3><font color="#6c0023">Specific scripts and daemons</font></h3>
claudinei@267 94
claudinei@267 95 <h4>bootopts.sh - LiveCD mode options</h4>
claudinei@267 96 <p>
claudinei@267 97 This script is used to configure the LiveCD options passed
claudinei@267 98 at boot time and is readable via the /proc/cmdline file.
claudinei@267 99 This is the script that allows you to use a USB key or
claudinei@267 100 external hard disk <code>/home</code> partition with the option home=usb
claudinei@267 101 or home=sda[1-9] or directly specify the language and
claudinei@267 102 keyboard parameters.
claudinei@267 103 </p>
claudinei@267 104
claudinei@267 105 <h4>network.sh - Initializing the network</h4>
claudinei@267 106 <p>
claudinei@267 107 This script searches the network.sh configuration file
claudinei@267 108 /etc/network.conf for the network interface to use; if one wants to
claudinei@267 109 launch the DHCP client (or not) or if you want to use a fixed
claudinei@267 110 (static) IP. On SliTaz the /etc/init.d/network.sh
claudinei@267 111 script configures the network interfaces to start using the
claudinei@267 112 information contained in /etc/network.conf. If the variable
claudinei@267 113 $DHCP is equal to yes, then the /etc/init.d/network.sh
claudinei@267 114 script launches the DHCP client on the $INTERFACE interface.
claudinei@267 115 </p>
claudinei@267 116
claudinei@267 117 <h4>i18n.sh - Internationalization</h4>
claudinei@267 118 <p>
claudinei@267 119 SliTaz backs up the configuration of the default locale in
claudinei@267 120 /etc/locale.conf which is read by /etc/profile at each
claudinei@267 121 login. The /etc/locale.conf is generated during boot time
claudinei@267 122 thanks to the /etc/i18n.sh script. This script launches the
claudinei@267 123 'tazlocale' application if /etc/locale.conf doesn't exist.
claudinei@267 124 We use the same process for the keyboard layout using 'tazkmap'
claudinei@267 125 and the /etc/kmap.conf configuration file. Both applications
claudinei@267 126 are installed and located in /sbin and use dialog and the
claudinei@267 127 ncurses library. The script also checks whether the
claudinei@267 128 configuration file for the time zone /etc/TZ exists,
claudinei@267 129 otherwise it creates one relying on the keyboard configuration.
claudinei@267 130 </p>
claudinei@267 131
claudinei@267 132 <h4>local.sh - Local commands</h4>
claudinei@267 133 <p>
claudinei@267 134 The /etc/init.d/local.sh script allows the system administrator
claudinei@267 135 to add local commands to be executed at boot. Example:
claudinei@267 136 </p>
claudinei@267 137 <pre class="script">#!/bin/sh
claudinei@267 138 # /etc/init.d/local.sh: Local startup commands.
claudinei@267 139 # All commands here will be executed at boot time.
claudinei@267 140 #
claudinei@267 141 . /etc/init.d/rc.functions
claudinei@267 142
claudinei@267 143 echo "Starting local startup commands... "
claudinei@267 144
claudinei@267 145 </pre>
claudinei@267 146
claudinei@267 147 <h4>rc.shutdown</h4>
claudinei@267 148 <p>
claudinei@267 149 This script is invoked by /etc/inittab during system shutdown.
claudinei@267 150 It also stops all daemons via the variable RUN_DAEMONS in
claudinei@267 151 the primary <code>/etc/rcS.conf</code> configuration file.
claudinei@267 152 </p>
claudinei@267 153
claudinei@267 154 <a name="inittab"></a>
claudinei@267 155 <h3><font color="#6c0023">/etc/inittab - Configuration file init</font></h3>
claudinei@267 156 <p>
claudinei@267 157 The first file read by the Kernel at boot. It defines the
claudinei@267 158 initialization script (/etc/init.d/rcS), shells (ttys) and
claudinei@267 159 actions in the event of a reboot or disruption. You will find
claudinei@267 160 a complete example with accompanying notes in <a href="http://www.slitaz.org/en/doc/cookbook/slitaz-tools.html">SliTaz tools</a>:
claudinei@267 161 </p>
claudinei@267 162 <pre class="script"># /etc/inittab: init configuration for SliTaz GNU/Linux.
claudinei@267 163 # Boot-time system configuration/initialization script.
claudinei@267 164 #
claudinei@267 165 ::sysinit:/etc/init.d/rcS
claudinei@267 166
claudinei@267 167 # /sbin/getty respawn shell invocations for selected ttys.
claudinei@267 168 tty1::respawn:/sbin/getty 38400 tty1
claudinei@267 169 tty2::respawn:/sbin/getty 38400 tty2
claudinei@267 170 tty3::respawn:/sbin/getty 38400 tty3
claudinei@267 171 tty4::respawn:/sbin/getty 38400 tty4
claudinei@267 172 tty5::respawn:/sbin/getty 38400 tty5
claudinei@267 173 tty6::respawn:/sbin/getty 38400 tty6
claudinei@267 174
claudinei@267 175 # Stuff to do when restarting the init
claudinei@267 176 # process, or before rebooting.
claudinei@267 177 ::restart:/etc/init.d/rc.shutdown
claudinei@267 178 ::restart:/sbin/init
claudinei@267 179 ::ctrlaltdel:/sbin/reboot
claudinei@267 180 ::shutdown:/etc/init.d/rc.shutdown
claudinei@267 181
claudinei@267 182 </pre>
claudinei@267 183 <h4>Following chapter</h4>
claudinei@267 184 <p>
claudinei@267 185 The next chapter continues on with the <a href="x-window-system.html">X window system</a>.
claudinei@267 186 </p>
claudinei@267 187
claudinei@267 188 <!-- End of content -->
claudinei@267 189 </div>
claudinei@267 190
claudinei@267 191 <!-- Footer. -->
claudinei@267 192 <div id="footer">
claudinei@267 193 <div class="footer-right"></div>
claudinei@267 194 <a href="#top">Top of the page</a> |
claudinei@267 195 <a href="index.html">Table of contents</a>
claudinei@267 196 </div>
claudinei@267 197
claudinei@267 198 <div id="copy">
claudinei@267 199 Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
claudinei@267 200 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
claudinei@267 201 Documentation is under
claudinei@267 202 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
claudinei@267 203 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
claudinei@267 204 </div>
claudinei@267 205
claudinei@267 206 </body>
claudinei@267 207 </html>