1.\" Copyright (c) 1988, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" from: @(#)shutdown.8 8.1 (Berkeley) 6/5/93 33.\" $Id: shutdown.8,v 1.5 1994/09/17 00:10:11 mycroft Exp $ 34.\" 35.Dd June 5, 1993 36.Dt SHUTDOWN 8 37.Os BSD 4 38.Sh NAME 39.Nm shutdown 40.Nd "close down the system at a given time" 41.Sh SYNOPSIS 42.Nm shutdown 43.Op Fl 44.Op Fl fhkrn 45.Ar time 46.Op Ar warning-message ... 47.Sh DESCRIPTION 48.Nm Shutdown 49provides an automated shutdown procedure for super-users 50to nicely notify users when the system is shutting down, 51saving them from system administrators, hackers, and gurus, who 52would otherwise not bother with such niceties. 53.Pp 54Available friendlinesses: 55.Bl -tag -width time 56.It Fl f 57.Nm Shutdown 58arranges, in the manner of 59.Xr fastboot 8 , 60for the file systems 61.Em not to be 62checked on reboot. 63.It Fl h 64The system is halted at the specified 65.Ar time 66when 67.Nm shutdown 68execs 69.Xr halt 8 . 70.It Fl k 71Kick every body off. 72The 73.Fl k 74option 75does not actually halt the system, but leaves the 76system multi-user with logins disabled (for all but super-user). 77.It Fl n 78Prevent the normal 79.Xr sync 2 80before stopping. 81.It Fl r 82.Nm Shutdown 83execs 84.Xr reboot 8 85at the specified 86.Ar time . 87.It Ar time 88.Ar Time 89is the time at which 90.Nm shutdown 91will bring the system down and 92may be the word 93.Ar now 94(indicating an immediate shutdown) or 95specify a future time in one of two formats: 96.Ar +number , 97or 98.Ar yymmddhhmm , 99where the year, month, and day may be defaulted 100to the current system values. The first form brings the system down in 101.Ar number 102minutes and the second at the absolute time specified. 103.It Ar warning-message 104Any other arguments comprise the warning message that is broadcast 105to users currently logged into the system. 106.It Fl 107If 108.Ql Fl 109is supplied as an option, the warning message is read from the standard 110input. 111.El 112.Pp 113At intervals, becoming more frequent as apocalypse approaches 114and starting at ten hours before shutdown, warning messages are displayed 115on the terminals of all users logged in. Five minutes before 116shutdown, or immediately if shutdown is in less than 5 minutes, 117logins are disabled by creating 118.Pa /etc/nologin 119and copying the 120warning message there. If this file exists when a user attempts to 121log in, 122.Xr login 1 123prints its contents and exits. The file is 124removed just before 125.Nm shutdown 126exits. 127.Pp 128At shutdown time a message is written in the system log, containing the 129time of shutdown, who initiated the shutdown and the reason. 130A terminate 131signal is then sent to 132.Xr init 133to bring the system down to single-user state (depending on above 134options). 135The time of the shutdown and the warning message 136are placed in 137.Pa /etc/nologin 138and should be used to 139inform the users about when the system will be back up 140and why it is going down (or anything else). 141.Sh FILES 142.Bl -tag -width /etc/nologin -compact 143.It Pa /etc/nologin 144tells login not to let anyone log in 145.It Pa /fastboot 146tells 147.Xr rc 8 148not to run fsck when rebooting 149.El 150.Sh SEE ALSO 151.Xr login 1 , 152.Xr wall 1 , 153.Xr fastboot 8 , 154.Xr halt 8 , 155.Xr reboot 8 156.Sh BACKWARD COMPATIBILITY 157The hours and minutes in the second time format may be separated by 158a colon (``:'') for backward compatibility. 159.Sh HISTORY 160The 161.Nm 162command appeared in 163.Bx 4.0 . 164