xref: /dflybsd-src/share/man/man9/boot.9 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino.\"	$NetBSD: boot.9,v 1.2 1996/09/24 07:01:26 ghudson Exp $
286d7f5d3SJohn Marino.\"
386d7f5d3SJohn Marino.\" Copyright (c) 1997
486d7f5d3SJohn Marino.\" 	Mike Pritchard.  All rights reserved.
586d7f5d3SJohn Marino.\"
686d7f5d3SJohn Marino.\" Copyright (c) 1994 Christopher G. Demetriou
786d7f5d3SJohn Marino.\" All rights reserved.
886d7f5d3SJohn Marino.\"
986d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without
1086d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions
1186d7f5d3SJohn Marino.\" are met:
1286d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
1386d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
1486d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
1586d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
1686d7f5d3SJohn Marino.\"    documentation and/or other materials provided with the distribution.
1786d7f5d3SJohn Marino.\" 3. All advertising materials mentioning features or use of this software
1886d7f5d3SJohn Marino.\"    must display the following acknowledgement:
1986d7f5d3SJohn Marino.\"      This product includes software developed by Christopher G. Demetriou
2086d7f5d3SJohn Marino.\"      for the NetBSD Project.
2186d7f5d3SJohn Marino.\" 3. The name of the author may not be used to endorse or promote products
2286d7f5d3SJohn Marino.\"    derived from this software without specific prior written permission
2386d7f5d3SJohn Marino.\"
2486d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2586d7f5d3SJohn Marino.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2686d7f5d3SJohn Marino.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2786d7f5d3SJohn Marino.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2886d7f5d3SJohn Marino.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2986d7f5d3SJohn Marino.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3086d7f5d3SJohn Marino.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3186d7f5d3SJohn Marino.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3286d7f5d3SJohn Marino.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3386d7f5d3SJohn Marino.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3486d7f5d3SJohn Marino.\"
3586d7f5d3SJohn Marino.\" $FreeBSD: src/share/man/man9/boot.9,v 1.4.2.2 2001/12/17 11:30:18 ru Exp $
3686d7f5d3SJohn Marino.\" $DragonFly: src/share/man/man9/boot.9,v 1.3 2007/04/07 20:19:52 swildner Exp $
3786d7f5d3SJohn Marino.\"
3886d7f5d3SJohn Marino.Dd April 7, 2007
3986d7f5d3SJohn Marino.Dt BOOT 9
4086d7f5d3SJohn Marino.Os
4186d7f5d3SJohn Marino.Sh NAME
4286d7f5d3SJohn Marino.Nm boot
4386d7f5d3SJohn Marino.Nd halt or reboot the system
4486d7f5d3SJohn Marino.Sh SYNOPSIS
4586d7f5d3SJohn Marino.In sys/types.h
4686d7f5d3SJohn Marino.In sys/systm.h
4786d7f5d3SJohn Marino.In sys/reboot.h
4886d7f5d3SJohn Marino.Ft void
4986d7f5d3SJohn Marino.Fn boot "int howto"
5086d7f5d3SJohn Marino.Sh DESCRIPTION
5186d7f5d3SJohn MarinoThe
5286d7f5d3SJohn Marino.Fn boot
5386d7f5d3SJohn Marinofunction handles final system shutdown, and either halts or reboots
5486d7f5d3SJohn Marinothe system.  The exact action to be taken is determined by the
5586d7f5d3SJohn Marinoflags passed in
5686d7f5d3SJohn Marino.Fa howto
5786d7f5d3SJohn Marinoand by whether or not the system has finished autoconfiguration.
5886d7f5d3SJohn Marino.Pp
5986d7f5d3SJohn MarinoIf the system has finished autoconfiguration,
6086d7f5d3SJohn Marino.Fn boot
6186d7f5d3SJohn Marinodoes the following:
6286d7f5d3SJohn Marino.Bl -enum -offset indent
6386d7f5d3SJohn Marino.It
6486d7f5d3SJohn MarinoIf this is the first invocation of
6586d7f5d3SJohn Marino.Fn boot
6686d7f5d3SJohn Marinoand the
6786d7f5d3SJohn Marino.Dv RB_NOSYNC
6886d7f5d3SJohn Marinoflag is not set in
6986d7f5d3SJohn Marino.Fa howto ,
7086d7f5d3SJohn Marinosyncs and unmounts the system disks by calling
7186d7f5d3SJohn Marino.Xr vfs_unmountall 9 .
7286d7f5d3SJohn Marino.It
7386d7f5d3SJohn MarinoDisables interrupts.
7486d7f5d3SJohn Marino.It
7586d7f5d3SJohn MarinoIf rebooting after a crash (i.e. if
7686d7f5d3SJohn Marino.Dv RB_DUMP
7786d7f5d3SJohn Marinois set in
7886d7f5d3SJohn Marino.Fa howto ,
7986d7f5d3SJohn Marinobut
8086d7f5d3SJohn Marino.Dv RB_HALT
8186d7f5d3SJohn Marinois not), saves a system crash dump.
8286d7f5d3SJohn Marino.It
8386d7f5d3SJohn MarinoRuns any shutdown hooks previously registered with
8486d7f5d3SJohn Marino.Xr EVENTHANDLER_REGISTER 9 .
8586d7f5d3SJohn Marino.It
8686d7f5d3SJohn MarinoPrints a message indicating that the system is about to be halted
8786d7f5d3SJohn Marinoor rebooted.
8886d7f5d3SJohn Marino.It
8986d7f5d3SJohn MarinoIf
9086d7f5d3SJohn Marino.Dv RB_HALT
9186d7f5d3SJohn Marinois set in
9286d7f5d3SJohn Marino.Fa howto ,
9386d7f5d3SJohn Marinohalts the system.
9486d7f5d3SJohn MarinoOtherwise, reboots the system.
9586d7f5d3SJohn Marino.El
9686d7f5d3SJohn Marino.Pp
9786d7f5d3SJohn MarinoIf the system has not finished autoconfiguration,
9886d7f5d3SJohn Marino.Fn boot
9986d7f5d3SJohn Marinoruns any shutdown hooks previously registered with
10086d7f5d3SJohn Marino.Xr EVENTHANDLER_REGISTER 9 ,
10186d7f5d3SJohn Marinoprints a message, and halts the system.
10286d7f5d3SJohn Marino.Sh SEE ALSO
10386d7f5d3SJohn Marino.Xr EVENTHANDLER 9 ,
10486d7f5d3SJohn Marino.Xr vfs_unmountall 9
105