1.\" $NetBSD: reboot.8,v 1.29 2011/02/16 19:32:26 wiz Exp $ 2.\" 3.\" Copyright (c) 1990, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" @(#)reboot.8 8.1 (Berkeley) 6/9/93 31.\" 32.Dd February 16, 2011 33.Dt REBOOT 8 34.Os 35.Sh NAME 36.Nm reboot , 37.Nm poweroff , 38.Nm halt 39.Nd restarting, powering down and stopping the system 40.Sh SYNOPSIS 41.Nm halt 42.Op Fl dlnpqvxz 43.Nm poweroff 44.Op Fl dlnqvxz 45.Nm 46.Op Fl dlnqvxz 47.Op Ar arg ... 48.Sh DESCRIPTION 49The 50.Nm poweroff , 51.Nm halt 52and 53.Nm 54utilities flush the file system cache to disk, send all running processes 55a 56.Dv SIGTERM , 57wait for up to 30 seconds for them to die, send a 58.Dv SIGKILL 59to the survivors and, respectively, power down, halt or restart the system. 60The action is logged, including entering a shutdown record into the login 61accounting file and sending a message via 62.Xr syslog 3 . 63.Pp 64The options are as follows: 65.Bl -tag -width Ds 66.It Fl d 67Create a dump before halting or restarting. 68This option is useful for debugging system dump procedures or 69capturing the state of a corrupted or misbehaving system. 70.It Fl l 71Suppress sending a message via 72.Xr syslog 3 73before halting or restarting. 74.It Fl n 75Do not flush the file system cache. 76This option should be used with extreme caution. 77It can be used if a disk or a processor is on fire. 78.It Fl p 79Attempt to powerdown the system. 80If the powerdown fails, or the system does not support 81software powerdown, the system will halt. 82This option is only valid for 83.Nm halt . 84.It Fl v 85To enable verbose messages on the console, pass the 86.Xr boothowto 9 87flag 88.Dv AB_VERBOSE 89to 90.Xr reboot 2 . 91.It Fl x 92To enable debugging messages on the console, pass the 93.Xr boothowto 9 94flag 95.Dv AB_DEBUG 96to 97.Xr reboot 2 . 98.It Fl z 99To silence some shutdown messages on the console, pass the 100.Xr boothowto 9 101flag 102.Dv AB_SILENT 103to 104.Xr reboot 2 . 105.It Fl q 106Do not give processes a chance to shut down before halting or restarting. 107This option should not normally be used. 108.El 109.Pp 110If there are any arguments passed to 111.Nm reboot 112they are concatenated with spaces and passed as 113.Fa bootstr 114to the 115.Xr reboot 2 116system call. 117The string is passed to the firmware on platforms that support it. 118.Pp 119Normally, the 120.Xr shutdown 8 121utility is used when the system needs to be halted or restarted, giving 122users advance warning of their impending doom. 123.Sh SEE ALSO 124.Xr reboot 2 , 125.Xr syslog 3 , 126.Xr utmp 5 , 127.Xr boot 8 , 128.Xr init 8 , 129.Xr rescue 8 , 130.Xr shutdown 8 , 131.Xr sync 8 132.Sh HISTORY 133A 134.Nm 135command appeared in 136.At v6 . 137.Pp 138The 139.Nm poweroff 140command first appeared in 141.Nx 1.5 . 142.Sh CAVEATS 143Once the command has begun its work, stopping it before it completes 144will probably result in a system so crippled it must be 145physically reset. 146To prevent premature termination, the command 147blocks many signals early in its execution. 148However, nothing can defend against deliberate attempts to evade this. 149.Pp 150This command will stop the system without running any 151.Xr shutdown 8 152scripts. 153Amongst other things, this means that swapping will not be 154disabled so that 155.Xr raid 4 156can shutdown cleanly. 157You should normally use 158.Xr shutdown 8 159unless you are running in single user mode. 160.Sh BUGS 161The single user shell will ignore the 162.Dv SIGTERM 163signal. 164To avoid waiting for the timeout when 165rebooting or halting from the single user shell, you have to 166.Ic exec reboot 167or 168.Ic exec halt . 169