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