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