xref: /dflybsd-src/share/man/man9/boot.9 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn Marino.\"	$NetBSD: boot.9,v 1.2 1996/09/24 07:01:26 ghudson Exp $
2*86d7f5d3SJohn Marino.\"
3*86d7f5d3SJohn Marino.\" Copyright (c) 1997
4*86d7f5d3SJohn Marino.\" 	Mike Pritchard.  All rights reserved.
5*86d7f5d3SJohn Marino.\"
6*86d7f5d3SJohn Marino.\" Copyright (c) 1994 Christopher G. Demetriou
7*86d7f5d3SJohn Marino.\" All rights reserved.
8*86d7f5d3SJohn Marino.\"
9*86d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without
10*86d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions
11*86d7f5d3SJohn Marino.\" are met:
12*86d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
13*86d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
14*86d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
15*86d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
16*86d7f5d3SJohn Marino.\"    documentation and/or other materials provided with the distribution.
17*86d7f5d3SJohn Marino.\" 3. All advertising materials mentioning features or use of this software
18*86d7f5d3SJohn Marino.\"    must display the following acknowledgement:
19*86d7f5d3SJohn Marino.\"      This product includes software developed by Christopher G. Demetriou
20*86d7f5d3SJohn Marino.\"      for the NetBSD Project.
21*86d7f5d3SJohn Marino.\" 3. The name of the author may not be used to endorse or promote products
22*86d7f5d3SJohn Marino.\"    derived from this software without specific prior written permission
23*86d7f5d3SJohn Marino.\"
24*86d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25*86d7f5d3SJohn Marino.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26*86d7f5d3SJohn Marino.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27*86d7f5d3SJohn Marino.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28*86d7f5d3SJohn Marino.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29*86d7f5d3SJohn Marino.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30*86d7f5d3SJohn Marino.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31*86d7f5d3SJohn Marino.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32*86d7f5d3SJohn Marino.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33*86d7f5d3SJohn Marino.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34*86d7f5d3SJohn Marino.\"
35*86d7f5d3SJohn Marino.\" $FreeBSD: src/share/man/man9/boot.9,v 1.4.2.2 2001/12/17 11:30:18 ru Exp $
36*86d7f5d3SJohn Marino.\" $DragonFly: src/share/man/man9/boot.9,v 1.3 2007/04/07 20:19:52 swildner Exp $
37*86d7f5d3SJohn Marino.\"
38*86d7f5d3SJohn Marino.Dd April 7, 2007
39*86d7f5d3SJohn Marino.Dt BOOT 9
40*86d7f5d3SJohn Marino.Os
41*86d7f5d3SJohn Marino.Sh NAME
42*86d7f5d3SJohn Marino.Nm boot
43*86d7f5d3SJohn Marino.Nd halt or reboot the system
44*86d7f5d3SJohn Marino.Sh SYNOPSIS
45*86d7f5d3SJohn Marino.In sys/types.h
46*86d7f5d3SJohn Marino.In sys/systm.h
47*86d7f5d3SJohn Marino.In sys/reboot.h
48*86d7f5d3SJohn Marino.Ft void
49*86d7f5d3SJohn Marino.Fn boot "int howto"
50*86d7f5d3SJohn Marino.Sh DESCRIPTION
51*86d7f5d3SJohn MarinoThe
52*86d7f5d3SJohn Marino.Fn boot
53*86d7f5d3SJohn Marinofunction handles final system shutdown, and either halts or reboots
54*86d7f5d3SJohn Marinothe system.  The exact action to be taken is determined by the
55*86d7f5d3SJohn Marinoflags passed in
56*86d7f5d3SJohn Marino.Fa howto
57*86d7f5d3SJohn Marinoand by whether or not the system has finished autoconfiguration.
58*86d7f5d3SJohn Marino.Pp
59*86d7f5d3SJohn MarinoIf the system has finished autoconfiguration,
60*86d7f5d3SJohn Marino.Fn boot
61*86d7f5d3SJohn Marinodoes the following:
62*86d7f5d3SJohn Marino.Bl -enum -offset indent
63*86d7f5d3SJohn Marino.It
64*86d7f5d3SJohn MarinoIf this is the first invocation of
65*86d7f5d3SJohn Marino.Fn boot
66*86d7f5d3SJohn Marinoand the
67*86d7f5d3SJohn Marino.Dv RB_NOSYNC
68*86d7f5d3SJohn Marinoflag is not set in
69*86d7f5d3SJohn Marino.Fa howto ,
70*86d7f5d3SJohn Marinosyncs and unmounts the system disks by calling
71*86d7f5d3SJohn Marino.Xr vfs_unmountall 9 .
72*86d7f5d3SJohn Marino.It
73*86d7f5d3SJohn MarinoDisables interrupts.
74*86d7f5d3SJohn Marino.It
75*86d7f5d3SJohn MarinoIf rebooting after a crash (i.e. if
76*86d7f5d3SJohn Marino.Dv RB_DUMP
77*86d7f5d3SJohn Marinois set in
78*86d7f5d3SJohn Marino.Fa howto ,
79*86d7f5d3SJohn Marinobut
80*86d7f5d3SJohn Marino.Dv RB_HALT
81*86d7f5d3SJohn Marinois not), saves a system crash dump.
82*86d7f5d3SJohn Marino.It
83*86d7f5d3SJohn MarinoRuns any shutdown hooks previously registered with
84*86d7f5d3SJohn Marino.Xr EVENTHANDLER_REGISTER 9 .
85*86d7f5d3SJohn Marino.It
86*86d7f5d3SJohn MarinoPrints a message indicating that the system is about to be halted
87*86d7f5d3SJohn Marinoor rebooted.
88*86d7f5d3SJohn Marino.It
89*86d7f5d3SJohn MarinoIf
90*86d7f5d3SJohn Marino.Dv RB_HALT
91*86d7f5d3SJohn Marinois set in
92*86d7f5d3SJohn Marino.Fa howto ,
93*86d7f5d3SJohn Marinohalts the system.
94*86d7f5d3SJohn MarinoOtherwise, reboots the system.
95*86d7f5d3SJohn Marino.El
96*86d7f5d3SJohn Marino.Pp
97*86d7f5d3SJohn MarinoIf the system has not finished autoconfiguration,
98*86d7f5d3SJohn Marino.Fn boot
99*86d7f5d3SJohn Marinoruns any shutdown hooks previously registered with
100*86d7f5d3SJohn Marino.Xr EVENTHANDLER_REGISTER 9 ,
101*86d7f5d3SJohn Marinoprints a message, and halts the system.
102*86d7f5d3SJohn Marino.Sh SEE ALSO
103*86d7f5d3SJohn Marino.Xr EVENTHANDLER 9 ,
104*86d7f5d3SJohn Marino.Xr vfs_unmountall 9
105