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