1.\" $OpenBSD: shutdown.8,v 1.40 2015/01/21 19:29:52 naddy Exp $ 2.\" $NetBSD: shutdown.8,v 1.6 1995/03/18 15:01:07 cgd Exp $ 3.\" 4.\" Copyright (c) 1988, 1991, 1993 5.\" The Regents of the University of California. 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. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" @(#)shutdown.8 8.1 (Berkeley) 6/5/93 32.\" 33.Dd $Mdocdate: January 21 2015 $ 34.Dt SHUTDOWN 8 35.Os 36.Sh NAME 37.Nm shutdown 38.Nd close down the system at a given time 39.Sh SYNOPSIS 40.Nm shutdown 41.Op Fl 42.Op Fl dfhknpr 43.Ar time 44.Op Ar warning-message ... 45.Sh DESCRIPTION 46.Nm 47provides an automated shutdown procedure for superusers 48to nicely notify users when the system is shutting down, 49saving them from system administrators, hackers, and gurus, who 50would otherwise not bother with such niceties. 51When the 52.Nm 53command is issued without options the system is placed in single 54user mode at the indicated time after shutting down all system 55services. 56.Pp 57The options are as follows: 58.Bl -tag -width Ds 59.It Fl d 60When used with 61.Fl h , 62.Fl p , 63or 64.Fl r 65causes system to perform a dump. 66This option is useful for debugging system dump procedures or capturing the 67state of a corrupted or misbehaving system. 68See 69.Xr savecore 8 70for information on how to recover this dump. 71.It Fl f 72Create the file 73.Pa /fastboot 74so that the file systems will 75.Em not 76be checked by 77.Xr fsck 8 78during the next boot. 79(See 80.Xr rc 8 ) . 81.It Fl h 82The system is halted at the specified 83.Ar time 84when 85.Nm 86execs 87.Xr halt 8 . 88.It Fl k 89Kick everybody off. 90The 91.Fl k 92option 93does not actually halt the system, but leaves the 94system multi-user with logins disabled (for all but superuser). 95.It Fl n 96When used with 97.Fl h , 98.Fl p , 99or 100.Fl r 101prevents the normal 102.Xr sync 2 103before stopping the system. 104.It Fl p 105The system is powered down at the specified 106.Ar time . 107The 108.Fl p 109flag is passed on to 110.Xr halt 8 , 111causing machines which support automatic power down to do so after halting. 112.It Fl r 113.Nm 114execs 115.Xr reboot 8 116at the specified 117.Ar time . 118.It Ar time 119.Ar time 120is the time at which 121.Nm 122will bring the system down and 123may be the word 124.Ar now 125(indicating an immediate shutdown) or 126specify a future time in one of two formats: 127.Ar +number , 128or 129.Ar yymmddhhmm , 130where the year, month, and day may be defaulted 131to the current system values. 132The first form brings the system down in 133.Ar number 134minutes and the second at the absolute time specified. 135.It Ar warning-message 136Any other arguments comprise the warning message that is broadcast 137to users currently logged into the system. 138.It Fl 139If 140.Sq Fl 141is supplied as an option, the warning message is read from the standard 142input. 143.El 144.Pp 145At intervals, becoming more frequent as apocalypse approaches 146and starting at ten hours before shutdown, warning messages are displayed 147on the terminals of all users logged in. 148Five minutes before 149shutdown, or immediately if shutdown is in less than 5 minutes, 150logins are disabled by creating 151.Pa /etc/nologin 152and copying the 153warning message there. 154If this file exists when a user attempts to log in, 155.Xr login 1 156prints its contents and exits. 157The file is removed just before 158.Nm 159exits. 160.Pp 161At shutdown time a message is written in the system log, containing the 162time of shutdown, who initiated the shutdown and the reason. 163A terminate 164signal is then sent to 165.Em init 166to bring the system down to single-user state (depending on above 167options). 168The time of the shutdown and the warning message 169are placed in 170.Pa /etc/nologin 171and should be used to 172inform the users about when the system will be back up 173and why it is going down (or anything else). 174.Pp 175You can cancel a scheduled shutdown with the 176.Xr kill 1 177command by killing the shutdown process. 178.Sh FILES 179.Bl -tag -width /etc/rc.shutdown -compact 180.It Pa /etc/nologin 181tells login not to let anyone log in 182.It Pa /etc/rc.shutdown 183run by 184.Xr rc 8 185before the system is shutdown 186.It Pa /fastboot 187tells 188.Xr rc 8 189not to run 190.Xr fsck 8 191during the next boot 192.El 193.Sh SEE ALSO 194.Xr kill 1 , 195.Xr login 1 , 196.Xr wall 1 , 197.Xr halt 8 , 198.Xr rc.shutdown 8 , 199.Xr reboot 8 200.Sh STANDARDS 201The hours and minutes in the second time format may be separated by 202a colon 203.Pq Sq \&: 204for backward compatibility. 205.Sh HISTORY 206The 207.Nm 208command appeared in 209.Bx 4.0 . 210