Delete the references to device.hints because we don't use it.
[dragonfly.git] / en / books / handbook / boot / chapter.sgml
1 <!--
2      The FreeBSD Documentation Project
3
4      $FreeBSD: /usr/local/www/cvsroot/FreeBSD/doc/en_US.ISO8859-1/books/handbook/boot/chapter.sgml,v 1.64 2006/02/17 17:17:17 marck Exp $
5      $DragonFly: doc/en/books/handbook/boot/chapter.sgml,v 1.5 2006/09/17 18:45:52 victor Exp $
6 -->
7
8 <chapter id="boot">
9   <title>The &os; Booting Process</title>
10
11   <sect1 id="boot-synopsis">
12     <title>Synopsis</title>
13     <indexterm><primary>booting</primary></indexterm>
14     <indexterm><primary>bootstrap</primary></indexterm>
15
16     <para>The process of starting a computer and loading the operating system
17       is referred to as <quote>the bootstrap process</quote>, or simply
18       <quote>booting</quote>.  &os;'s boot process provides a great deal of
19       flexibility in customizing what happens when you start the system,
20       allowing you to select from different operating systems installed on the
21       same computer, or even different versions of the same operating system
22       or installed kernel.</para>
23
24     <para>This chapter details the configuration options you can set and how
25       to customize the &os; boot process.  This includes everything that
26       happens until the &os; kernel has started, probed for devices, and
27       started &man.init.8;.  If you are not quite sure when this happens, it
28       occurs when the text color changes from bright white to grey.</para>
29
30     <para>After reading this chapter, you will know:</para>
31
32     <itemizedlist>
33       <listitem>
34         <para>What the components of the &os; bootstrap system are, and how
35           they interact.</para>
36       </listitem>
37
38       <listitem>
39         <para>The options you can give to the components in the &os;
40           bootstrap to control the boot process.</para>
41       </listitem>
42     </itemizedlist>
43
44     <note>
45       <title>x86 Only</title>
46
47       <para>This chapter only describes the boot process for &os; running
48         on x86 systems.</para>
49     </note>
50   </sect1>
51
52   <sect1 id="boot-introduction">
53     <title>The Booting Problem</title>
54
55     <para>Turning on a computer and starting the operating system poses an
56       interesting dilemma.  By definition, the computer does not know how to
57       do anything until the operating system is started.  This includes
58       running programs from the disk.  So if the computer can not run a
59       program from the disk without the operating system, and the operating
60       system programs are on the disk, how is the operating system
61       started?</para>
62
63     <para>This problem parallels one in the book <citetitle>The Adventures of
64       Baron Munchausen</citetitle>.  A character had fallen part way down a
65       manhole, and pulled himself out by grabbing his bootstraps, and
66       lifting.  In the early days of computing the term
67       <firstterm>bootstrap</firstterm> was applied to the mechanism used to
68       load the operating system, which has become shortened to
69       <quote>booting</quote>.</para>
70
71     <indexterm><primary>BIOS</primary></indexterm>
72
73     <indexterm><primary>Basic Input/Output
74     System</primary><see>BIOS</see></indexterm>
75
76     <para>On x86 hardware the Basic Input/Output System (BIOS) is responsible
77       for loading the operating system.  To do this, the BIOS looks on the
78       hard disk for the Master Boot Record (MBR), which must be located on a
79       specific place on the disk.  The BIOS has enough knowledge to load and
80       run the MBR, and assumes that the MBR can then carry out the rest of the
81       tasks involved in loading the operating system
82       possibly with the help of the BIOS.</para>
83  
84     <indexterm><primary>Master Boot Record (MBR)</primary></indexterm>
85
86     <indexterm><primary>Boot Manager</primary></indexterm>
87     
88     <indexterm><primary>Boot Loader</primary></indexterm>
89  
90     <para>The code within the MBR is usually referred to as a <emphasis>boot
91       manager</emphasis>, especially when it interacts with the user.  In this
92       case the boot manager usually has more code in the first
93       <emphasis>track</emphasis> of the disk or within some OS's file system.
94       (A  boot manager is sometimes also called a <emphasis>boot
95       loader</emphasis>, but &os; uses that term for a later stage of
96       booting.) Popular boot managers include <application>boot0</application>
97       (a.k.a. <application>Boot Easy</application>, the standard &os; boot
98       manager), <application>Grub</application>,
99       <application>GAG</application>, and <application>LILO</application>.
100       (Only <application>boot0</application> fits within the MBR.)</para>
101
102     <para>If you have only one operating system installed on your disks then
103       a standard PC MBR will suffice.  This MBR searches for the first bootable
104       (a.k.a. active) slice on the disk, and then runs the code on that slice to
105       load the remainder of the operating system.  The MBR installed by
106       &man.fdisk.8;, by default, is such an MBR.  It is based on
107       <filename>/boot/mbr</filename>.</para>
108    
109     <para>If you have installed multiple operating systems on your disks then
110       you can install a different boot manager, one that can display a list of
111       different operating systems, and allows you to choose the one to boot
112       from.  Two of these are discussed in the next subsection.</para>
113
114     <para>The remainder of the &os; bootstrap system is divided into three
115       stages.  The first stage is run by the MBR, which knows just enough to
116       get the computer into a specific state and run the second stage.  The
117       second stage can do a little bit more, before running the third stage.
118       The third stage finishes the task of loading the operating system.  The
119       work is split into these three stages because the PC standards put
120       limits on the size of the programs that can be run at stages one and
121       two.  Chaining the tasks together allows &os; to provide a more
122       flexible loader.</para>
123
124     <indexterm><primary>kernel</primary></indexterm>
125     <indexterm><primary><command>init</command></primary></indexterm>
126
127     <para>The kernel is then started and it begins to probe for devices
128       and initialize them for use.  Once the kernel boot
129       process is finished, the kernel passes control to the user process
130       &man.init.8;, which then makes sure the disks are in a usable state.
131       &man.init.8; then starts the user-level resource configuration which
132       mounts file systems, sets up network cards to communicate on the
133       network, and generally starts all the processes that usually
134       are run on a &os; system at startup.</para>
135   </sect1>
136
137   <sect1 id="boot-blocks">
138     <title>The Boot Manager and Boot Stages</title>
139
140     <indexterm><primary>Boot Manager</primary></indexterm>
141
142     <sect2 id="boot-boot0">
143       <title>The Boot Manager</title>
144       <indexterm><primary>Master Boot Record (MBR)</primary></indexterm>
145
146     <para>The code in the MBR or boot manager is sometimes referred to as
147       <emphasis>stage zero</emphasis> of the boot process.  This subsection
148       discusses two of the boot managers previously mentioned:
149       <application>boot0</application> and <application>LILO</application>.</para>
150
151     <formalpara><title>The <application>boot0</application> Boot Manager:</title>
152       <para>The MBR installed by &os;'s installer or &man.boot0cfg.8;, by
153         default, is based on <filename>/boot/boot0</filename>.
154         (The <application>boot0</application> program is very simple, since the
155         program in the <abbrev>MBR</abbrev> can only be 446 bytes long because of the slice
156         table and <literal>0x55AA</literal> identifier at the end of the MBR.)
157         If you have installed <application>boot0</application> and
158         multiple operating systems on your hard disks, then you will see a
159         display similar to this one at boot time:</para></formalpara>
160
161       <example id="boot-boot0-example">
162         <title><filename>boot0</filename> Screenshot</title>
163
164         <screen>F1 DOS
165 F2 DF/FBSD
166 F3 Linux
167 F4 ??
168 F5 Drive 1
169
170 Default: F2</screen>
171       </example>
172
173       <para>Other operating systems, in particular &windows;, have been known
174         to overwrite an existing MBR with their own.  If this happens to you,
175         or you want to replace your existing MBR with the &os; MBR then use
176         the following command:</para>
177
178       <screen>&prompt.root; <userinput>fdisk -B -b /boot/boot0 <replaceable>device</replaceable></userinput></screen>
179
180       <para>where <replaceable>device</replaceable> is the device that you
181         boot from, such as <devicename>ad0</devicename> for the first IDE
182         disk, <devicename>ad2</devicename> for the first IDE disk on a second
183         IDE controller, <devicename>da0</devicename> for the first SCSI disk,
184         and so on. Or, if you want a custom configuration of the MBR,
185     use &man.boot0cfg.8;.</para>
186
187    <formalpara><title>The LILO Boot Manager:</title>
188
189     <para>To install this boot manager so it will also boot &os;, first
190       start Linux and add the following to your existing
191       <filename>/etc/lilo.conf</filename> configuration file:</para></formalpara>
192
193    <programlisting>other=/dev/hdXY
194 table=/dev/hdX
195 loader=/boot/chain.b
196 label=&os;</programlisting>
197
198     <para>In the above, specify &os;'s primary partition and drive using
199       Linux specifiers, replacing <replaceable>X</replaceable> with the Linux
200       drive letter and <replaceable>Y</replaceable> with the Linux primary
201       partition number.  If you are using a <acronym>SCSI</acronym> drive, you
202       will need to change <replaceable>/dev/hd</replaceable> to read something
203       similar to <replaceable>/dev/sd</replaceable>.  The
204       <option>loader=/boot/chain.b</option> line can be omitted if you have
205       both operating systems on the same drive.  Now run
206       <command>/sbin/lilo&nbsp;-v</command> to commit your new changes to the
207       system; this should be verified by checking its screen messages.</para>
208     </sect2>
209   
210     <sect2 id="boot-boot1">
211       <title>Stage One, <filename>/boot/boot1</filename>, and Stage Two,
212         <filename>/boot/boot2</filename></title>
213       
214     <para>Conceptually the first and second stages are part of the same
215       program, on the same area of the disk.  Because of space constraints
216       they have been split into two, but you would always install them
217       together.  They are copied from the combined file
218       <filename>/boot/boot</filename> by the installer or
219       <application>disklabel</application> (see below).</para>
220
221     <para>They are located outside file systems, in the first track of
222       the boot slice, starting with the first sector.  This is where <link
223       linkend="boot-boot0">boot0</link>, or any other boot manager,
224       expects to find a program to run which will
225       continue the boot process.  The number of sectors used is easily
226       determined from the size of <filename>/boot/boot</filename>.</para>
227
228     <para>They are found on the boot sector of
229       the boot slice, which is where <link
230           linkend="boot-boot0">boot0</link>, or any other program on the
231       <abbrev>MBR</abbrev> expects to find the program to run to
232       continue the boot process.  The files in the
233       <filename>/boot</filename> directory are copies of the real files,
234       which are stored outside of the &os; file system.</para>
235
236       <para><filename>boot1</filename> is very simple, since it 
237         can only be 512 bytes
238         in size, and knows just enough about the &os;
239         <firstterm>disklabel</firstterm>, which stores information
240         about the slice, to find and execute <filename>boot2</filename>.</para>
241       
242       <para><filename>boot2</filename> is slightly more sophisticated, and understands
243         the &os; file system enough to find files on it, and can
244         provide a simple interface to choose the kernel or loader to
245         run.</para>
246
247       <para>Since the <link linkend="boot-loader">loader</link> is
248         much more sophisticated, and provides a nice easy-to-use
249         boot configuration, <filename>boot2</filename> usually runs
250         it, but previously it
251         was tasked to run the kernel directly.</para>
252
253       <example id="boot-boot2-example">
254         <title><filename>boot2</filename> Screenshot</title>
255
256         <screen>&gt;&gt; DragonFly/i386 BOOT
257 Default: 0:ad(0,a)/boot/loader
258 boot:</screen>
259       </example>
260
261       <para>If you ever need to replace the installed
262         <filename>boot1</filename> and <filename>boot2</filename> use
263         &man.disklabel.8;:</para>
264       
265       <screen>&prompt.root; <userinput>disklabel -B <replaceable>diskslice</replaceable></userinput></screen>
266
267       <para>where <replaceable>diskslice</replaceable> is the disk and slice
268         you boot from, such as <devicename>ad0s1</devicename> for the first
269         slice on the first IDE disk.</para>
270
271     </sect2>
272
273   <sect2 id="boot-loader">
274     <title>Stage Three, <filename>/boot/loader</filename></title>
275
276     <indexterm><primary>boot-loader</primary></indexterm>
277     <para>The loader is the final stage of the three-stage
278       bootstrap, and is located on the file system, usually as
279       <filename>/boot/loader</filename>.</para>
280       
281     <para>The loader is intended as a user-friendly method for
282       configuration, using an easy-to-use built-in command set,
283       backed up by a more powerful interpreter, with a more complex
284       command set.</para> 
285
286     <sect3 id="boot-loader-flow">
287       <title>Loader Program Flow</title>
288       
289       <para>During initialization, the loader will probe for a
290         console and for disks, and figure out what disk it is
291         booting from.  It will set variables accordingly, and an
292         interpreter is started where user commands can be passed from
293         a script or interactively.</para>
294       <indexterm><primary>loader</primary></indexterm>
295       <indexterm><primary>loader configuration</primary></indexterm>
296
297       <!-- XXX talk about the boot menu -->
298       <para>The loader will then read
299         <filename>/boot/loader.rc</filename>, which by default reads
300         in <filename>/boot/defaults/loader.conf</filename> which
301         sets reasonable defaults for variables and reads
302         <filename>/boot/loader.conf</filename> for local changes to
303         those variables.  <filename>loader.rc</filename> then acts
304         on these variables, loading whichever modules and kernel are
305         selected.</para>
306
307       <para>Finally, by default, the loader will show you the booting
308         menu where you can select different options. This menu issues
309         a 10 second wait for key presses, and boots the kernel if it
310         is not interrupted.  If the user selects
311         <option>"Escape to loader prompt"</option>, the user is presented
312         with a prompt which understands the easy-to-use command set,
313         where the user may adjust variables, unload all modules,
314         load modules, and then finally boot or reboot.</para>
315
316     </sect3>
317     
318     <sect3 id="boot-loader-commands">
319       <title>Loader Built-In Commands</title>
320       
321       <para>These are the most commonly used loader commands.  For a
322         complete discussion of all available commands, please see
323         &man.loader.8;.</para>
324
325       <variablelist>
326         <varlistentry>
327           <term>autoboot <replaceable>seconds</replaceable></term>
328
329           <listitem>
330             <para>Proceeds to boot the kernel if not interrupted
331               within the time span given, in seconds.  It displays a
332               countdown, and the default time span is 10
333               seconds.</para>
334           </listitem>
335         </varlistentry>
336
337         <varlistentry>
338           <term>boot
339             <optional><replaceable>-options</replaceable></optional>
340             <optional><replaceable>kernelname</replaceable></optional></term>
341
342           <listitem>
343             <para>Immediately proceeds to boot the kernel, with the
344               given options, if any, and with the kernel name given,
345               if it is.</para>
346           </listitem>
347         </varlistentry>
348
349         <varlistentry>
350           <term>boot-conf</term>
351
352           <listitem>
353             <para>Goes through the same automatic configuration of
354               modules based on variables as what happens at boot.
355               This only makes sense if you use
356               <command>unload</command> first, and change some
357               variables, most commonly <envar>kernel</envar>.</para>
358           </listitem>
359         </varlistentry>
360
361         <varlistentry>
362           <term>help
363             <optional><replaceable>topic</replaceable></optional></term>
364
365           <listitem>
366             <para>Shows help messages read from
367               <filename>/boot/loader.help</filename>.  If the topic
368               given is <literal>index</literal>, then the list of
369               available topics is given.</para>
370           </listitem>
371         </varlistentry>
372
373         <varlistentry>
374           <term>include <replaceable>filename</replaceable>
375             &hellip;</term>
376
377           <listitem>
378             <para>Processes the file with the given filename.  The
379               file is read in, and interpreted line by line.  An
380               error immediately stops the include command.</para>
381           </listitem>
382         </varlistentry>
383         <varlistentry>
384           <term>load <optional><option>-t</option>
385             <replaceable>type</replaceable></optional>
386             <replaceable>filename</replaceable></term>
387
388           <listitem>
389             <para>Loads the kernel, kernel module, or file of the
390               type given, with the filename given.  Any arguments
391               after filename are passed to the file.</para>
392           </listitem>
393         </varlistentry>
394         <varlistentry>
395           <term>ls <optional><option>-l</option></optional>
396             <optional><replaceable>path</replaceable></optional></term>
397
398           <listitem>
399             <para>Displays a listing of files in the given path, or
400               the root directory, if the path is not specified.  If
401               <option>-l</option> is specified, file sizes will be
402               shown too.</para>
403           </listitem>
404         </varlistentry>
405         <varlistentry>
406           <term>lsdev <optional><option>-v</option></optional></term>
407
408           <listitem>
409             <para>Lists all of the devices from which it may be
410               possible to load modules. If <option>-v</option> is
411               specified, more details are printed.</para>
412           </listitem>
413         </varlistentry>
414
415         <varlistentry>
416           <term>lsmod <optional><option>-v</option></optional></term>
417
418           <listitem>
419             <para>Displays loaded modules. If <option>-v</option> is
420               specified, more details are shown.</para>
421           </listitem>
422         </varlistentry>
423
424         <varlistentry>
425           <term>more <replaceable>filename</replaceable></term>
426
427           <listitem>
428             <para>Displays the files specified, with a pause at each
429               <varname>LINES</varname> displayed.</para>
430           </listitem>
431         </varlistentry>
432
433         <varlistentry>
434           <term>reboot</term>
435
436           <listitem>
437             <para>Immediately reboots the system.</para>
438           </listitem>
439         </varlistentry>
440
441         <varlistentry>
442           <term>set <replaceable>variable</replaceable></term>
443           <term>set
444             <replaceable>variable</replaceable>=<replaceable>value</replaceable></term>
445
446           <listitem>
447             <para>Sets the loader's environment variables.</para>
448           </listitem>
449         </varlistentry>
450
451         <varlistentry>
452           <term>unload</term>
453
454           <listitem>
455             <para>Removes all loaded modules.</para>
456           </listitem>
457         </varlistentry>
458       </variablelist>
459     </sect3>
460
461     <sect3 id="boot-loader-examples">
462       <title>Loader Examples</title>
463
464       <para>Here are some practical examples of loader usage:</para>
465
466       <itemizedlist>
467         <indexterm><primary>single-user mode</primary></indexterm>
468         <listitem>
469           <para>To simply boot your usual kernel, but in single-user
470             mode you can select the <option>"Boot DragonFly in single user mode"</option>.</para>
471         </listitem>
472
473         <listitem>
474           <para>To unload your usual kernel and modules, and then
475             load just your old (or another) kernel:</para>
476     <indexterm>
477       <primary><filename>kernel.old</filename></primary>
478     </indexterm>
479
480           <screen><userinput>unload</userinput>
481 <userinput>load <replaceable>kernel.old</replaceable></userinput></screen>
482
483           <para>You can use <filename>kernel.old</filename> to refer to
484             your previously installed kernel (when you have upgraded
485             or configured your own kernel, for example).</para>
486
487           <note>
488             <para>Use the following to load your usual modules with
489               another kernel:</para>
490
491             <screen><userinput>unload</userinput>
492 <userinput>set kernel="<replaceable>kernel.old</replaceable>"</userinput>
493 <userinput>boot-conf</userinput></screen></note>
494         </listitem>
495
496         <listitem>
497           <para>To load a kernel configuration script (an automated
498             script which does the things you would normally do in the
499             kernel boot-time configurator):</para>
500
501           <screen><userinput>load -t userconfig_script <replaceable>/boot/kernel.conf</replaceable></userinput></screen>
502         </listitem>
503       </itemizedlist>
504   </sect3>
505     </sect2>
506   </sect1>
507
508   <sect1 id="boot-kernel">
509     <title>Kernel Interaction During Boot</title>
510     <indexterm>
511       <primary>kernel</primary>
512       <secondary>boot interaction</secondary>
513     </indexterm>
514     
515     <para>Once the kernel is loaded by either <link
516         linkend="boot-loader">loader</link> (as usual) or <link
517         linkend="boot-boot1">boot2</link> (bypassing the loader), it
518       examines its boot flags, if any, and adjusts its behavior as
519       necessary.</para>
520
521     <sect2 id="boot-kernel-bootflags">
522       <indexterm>
523         <primary>kernel</primary>
524         <secondary>bootflags</secondary>
525       </indexterm>
526       <title>Kernel Boot Flags</title>
527
528       <para>Here are the more common boot flags:</para>
529
530       <variablelist id="boot-kernel-bootflags-list">
531         <varlistentry>
532           <term><option>-a</option></term>
533
534           <listitem>
535             <para>during kernel initialization, ask for the device
536               to mount as the root file system.</para>
537           </listitem>
538         </varlistentry>
539
540         <varlistentry>
541           <term><option>-C</option></term>
542
543           <listitem>
544             <para>boot from CDROM.</para>
545           </listitem>
546         </varlistentry>
547
548         <varlistentry>
549           <term><option>-c</option></term>
550
551           <listitem>
552             <para>run UserConfig, the boot-time kernel
553               configurator</para>
554           </listitem>
555         </varlistentry>
556
557         <varlistentry>
558           <term><option>-s</option></term>
559
560           <listitem>
561             <para>boot into single-user mode</para>
562           </listitem>
563         </varlistentry>
564
565         <varlistentry>
566           <term><option>-v</option></term>
567
568           <listitem>
569             <para>be more verbose during kernel startup</para>
570           </listitem>
571         </varlistentry>
572       </variablelist>
573
574       <note>
575         <para>There are other boot flags; read &man.boot.8; for more
576           information on them.</para></note>
577     </sect2>
578
579   </sect1>
580   
581   <sect1 id="boot-init">
582     <indexterm>
583       <primary><command>init</command></primary>
584     </indexterm>
585     <title>Init: Process Control Initialization</title>
586         
587     <para>Once the kernel has finished booting, it passes control to
588       the user process &man.init.8;, which is located at
589       <filename>/sbin/init</filename>, or the program path specified
590       in the <envar>init_path</envar> variable in
591       <command>loader</command>.</para>
592
593     <sect2 id="boot-autoreboot">
594       <title>Automatic Reboot Sequence</title>
595       
596       <para>The automatic reboot sequence makes sure that the
597         file systems available on the system are consistent.  If they
598         are not, and &man.fsck.8; cannot fix the
599         inconsistencies, &man.init.8; drops the system
600         into <link linkend="boot-singleuser">single-user mode</link>
601         for the system administrator to take care of the problems
602         directly.</para>
603     </sect2>
604
605     <sect2 id="boot-singleuser">
606       <title>Single-User Mode</title>
607       <indexterm><primary>single-user mode</primary></indexterm>
608       <indexterm><primary>console</primary></indexterm>
609       
610       <para>This mode can be reached through the <link
611           linkend="boot-autoreboot">automatic reboot
612           sequence</link>, with the
613           <option>"Boot DragonFly in single user mode"</option>
614           menu option, by the user booting with the
615           <option>-s</option> option from the loader prompt or setting the
616           <envar>boot_single</envar> variable in
617           <command>loader</command>.</para>
618
619       <para>It can also be reached by calling
620         &man.shutdown.8; without the reboot
621         (<option>-r</option>) or halt (<option>-h</option>) options,
622         from <link linkend="boot-multiuser">multi-user
623           mode</link>.</para>
624
625       <para>If the system <literal>console</literal> is set
626         to <literal>insecure</literal> in <filename>/etc/ttys</filename>,
627         then the system prompts for the <username>root</username> password
628         before initiating single-user mode.</para>
629
630       <example id="boot-insecure-console">
631         <title>An Insecure Console in <filename>/etc/ttys</filename></title>
632
633         <programlisting># name  getty                           type    status          comments
634 #
635 # If console is marked "insecure", then init will ask for the root password
636 # when going to single-user mode.
637 console none                            unknown off insecure</programlisting>
638       </example>
639
640       <note>
641         <para>An <literal>insecure</literal> console means that you
642           consider your physical security to the console to be
643           insecure, and want to make sure only someone who knows the
644           <username>root</username> password may use single-user mode, and it
645           does not mean that you want to run your console insecurely.  Thus,
646           if you want security, choose <literal>insecure</literal>,
647           not <literal>secure</literal>.</para>
648       </note>
649     </sect2>
650     
651     <sect2 id="boot-multiuser">
652       <title>Multi-User Mode</title>
653       <indexterm><primary>multi-user mode</primary></indexterm>
654       
655       <para>If &man.init.8; finds your file systems to be
656         in order, or once the user has finished in <link
657           linkend="boot-singleuser">single-user mode</link>, the
658         system enters multi-user mode, in which it starts the
659         resource configuration of the system.</para>
660
661       <sect3 id="boot-rc">
662       <indexterm><primary>rc files</primary></indexterm>
663         <title>Resource Configuration (rc)</title>
664
665         <para>The resource configuration system reads in
666           configuration defaults from
667           <filename>/etc/defaults/rc.conf</filename>, and
668           system-specific details from
669           <filename>/etc/rc.conf</filename>, and then proceeds to
670           mount the system file systems mentioned in
671           <filename>/etc/fstab</filename>, start up networking
672           services, start up miscellaneous system daemons, and
673           finally runs the startup scripts of locally installed
674           packages.</para>
675
676         <para>The &man.rc.8; manual page is a good reference to the resource
677           configuration system, as is examining the scripts
678           themselves.</para>
679       </sect3>
680     </sect2>
681   </sect1>
682
683   <sect1 id="boot-shutdown">
684     <title>Shutdown Sequence</title>
685     <indexterm>
686       <primary><command>shutdown</command></primary>
687     </indexterm>
688
689     <para>Upon controlled shutdown, via &man.shutdown.8;,
690       &man.init.8; will attempt to run the script
691       <filename>/etc/rc.shutdown</filename>, and then proceed to send
692       all processes the <literal>TERM</literal> signal, and subsequently 
693       the <literal>KILL</literal> signal to any that do not terminate 
694       timely.</para>
695
696     <para>To power down a &os; machine on architectures and systems
697       that support power management, simply use the command
698       <command>shutdown -p now</command> to turn the power off
699       immediately.  To just reboot a &os; system, just use
700       <command>shutdown -r now</command>.  You need to be
701       <username>root</username> or a member of
702       <groupname>operator</groupname> group to run &man.shutdown.8;.
703       The &man.halt.8; and &man.reboot.8; commands can also be used,
704       please refer to their manual pages and to &man.shutdown.8;'s one
705       for more information.</para>
706
707     <note>
708       <para>Power management requires &man.acpi.4; support in the kernel
709         or loaded as a module, or &man.apm.4; support.</para>
710     </note>
711
712   </sect1>
713 </chapter>
714
715 <!-- 
716      Local Variables:
717      mode: sgml
718      sgml-declaration: "../chapter.decl"
719      sgml-indent-data: t
720      sgml-omittag: nil
721      sgml-always-quote-attributes: t
722      sgml-parent-document: ("../book.sgml" "part" "chapter")
723      End:
724 -->
725