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