1.\" $OpenBSD: shutdown.8,v 1.39 2007/11/19 08:51:49 jmc 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: November 19 2007 $ 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 62or 63.Fl r 64causes system to perform a dump. 65This option is useful for debugging system dump procedures or capturing the 66state of a corrupted or misbehaving system. 67See 68.Xr savecore 8 69for information on how to recover this dump. 70.It Fl f 71Create the file 72.Pa /fastboot 73so that the file systems will 74.Em not 75be checked by 76.Xr fsck 8 77during the next boot. 78(See 79.Xr rc 8 ) . 80.It Fl h 81The system is halted at the specified 82.Ar time 83when 84.Nm 85execs 86.Xr halt 8 . 87.It Fl k 88Kick everybody off. 89The 90.Fl k 91option 92does not actually halt the system, but leaves the 93system multi-user with logins disabled (for all but superuser). 94.It Fl n 95When used with 96.Fl h 97or 98.Fl r 99prevents the normal 100.Xr sync 2 101before stopping the system. 102.It Fl p 103The 104.Fl p 105flag is passed on to 106.Xr halt 8 , 107causing machines which support automatic power down to do so after halting. 108.It Fl r 109.Nm 110execs 111.Xr reboot 8 112at the specified 113.Ar time . 114.It Ar time 115.Ar time 116is the time at which 117.Nm 118will bring the system down and 119may be the word 120.Ar now 121(indicating an immediate shutdown) or 122specify a future time in one of two formats: 123.Ar +number , 124or 125.Ar yymmddhhmm , 126where the year, month, and day may be defaulted 127to the current system values. 128The first form brings the system down in 129.Ar number 130minutes and the second at the absolute time specified. 131.It Ar warning-message 132Any other arguments comprise the warning message that is broadcast 133to users currently logged into the system. 134.It Fl 135If 136.Sq Fl 137is supplied as an option, the warning message is read from the standard 138input. 139.El 140.Pp 141At intervals, becoming more frequent as apocalypse approaches 142and starting at ten hours before shutdown, warning messages are displayed 143on the terminals of all users logged in. 144Five minutes before 145shutdown, or immediately if shutdown is in less than 5 minutes, 146logins are disabled by creating 147.Pa /etc/nologin 148and copying the 149warning message there. 150If this file exists when a user attempts to log in, 151.Xr login 1 152prints its contents and exits. 153The file is removed just before 154.Nm 155exits. 156.Pp 157At shutdown time a message is written in the system log, containing the 158time of shutdown, who initiated the shutdown and the reason. 159A terminate 160signal is then sent to 161.Em init 162to bring the system down to single-user state (depending on above 163options). 164The time of the shutdown and the warning message 165are placed in 166.Pa /etc/nologin 167and should be used to 168inform the users about when the system will be back up 169and why it is going down (or anything else). 170.Pp 171You can cancel a scheduled shutdown with the 172.Xr kill 1 173command by killing the shutdown process. 174.Sh FILES 175.Bl -tag -width /etc/rc.shutdown -compact 176.It Pa /etc/nologin 177tells login not to let anyone log in 178.It Pa /etc/rc.shutdown 179run by 180.Xr rc 8 181before the system is shutdown 182.It Pa /fastboot 183tells 184.Xr rc 8 185not to run 186.Xr fsck 8 187during the next boot 188.El 189.Sh SEE ALSO 190.Xr kill 1 , 191.Xr login 1 , 192.Xr wall 1 , 193.Xr halt 8 , 194.Xr rc.shutdown 8 , 195.Xr reboot 8 196.Sh STANDARDS 197The hours and minutes in the second time format may be separated by 198a colon 199.Pq Sq \&: 200for backward compatibility. 201.Sh HISTORY 202The 203.Nm 204command appeared in 205.Bx 4.0 . 206