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.\" @(#)shutdown.8 8.1 (Berkeley) 6/5/93 33.\" 34.Dd June 5, 1993 35.Dt SHUTDOWN 8 36.Os BSD 4 37.Sh NAME 38.Nm shutdown 39.Nd "close down the system at a given time" 40.Sh SYNOPSIS 41.Nm shutdown 42.Op Fl 43.Op Fl fhkrn 44.Ar time 45.Op Ar warning-message ... 46.Sh DESCRIPTION 47.Nm Shutdown 48provides an automated shutdown procedure for super-users 49to nicely notify users when the system is shutting down, 50saving them from system administrators, hackers, and gurus, who 51would otherwise not bother with such niceties. 52.Pp 53Available friendlinesses: 54.Bl -tag -width time 55.It Fl f 56.Nm Shutdown 57arranges, in the manner of 58.Xr fastboot 8 , 59for the file systems 60.Em not to be 61checked on reboot. 62.It Fl h 63The system is halted at the specified 64.Ar time 65when 66.Nm shutdown 67execs 68.Xr halt 8 . 69.It Fl k 70Kick every body off. 71The 72.Fl k 73option 74does not actually halt the system, but leaves the 75system multi-user with logins disabled (for all but super-user). 76.It Fl n 77Prevent the normal 78.Xr sync 2 79before stopping. 80.It Fl r 81.Nm Shutdown 82execs 83.Xr reboot 8 84at the specified 85.Ar time . 86.It Ar time 87.Ar Time 88is the time at which 89.Nm shutdown 90will bring the system down and 91may be the word 92.Ar now 93(indicating an immediate shutdown) or 94specify a future time in one of two formats: 95.Ar +number , 96or 97.Ar yymmddhhmm , 98where the year, month, and day may be defaulted 99to the current system values. The first form brings the system down in 100.Ar number 101minutes and the second at the absolute time specified. 102.It Ar warning-message 103Any other arguments comprise the warning message that is broadcast 104to users currently logged into the system. 105.It Fl 106If 107.Ql Fl 108is supplied as an option, the warning message is read from the standard 109input. 110.El 111.Pp 112At intervals, becoming more frequent as apocalypse approaches 113and starting at ten hours before shutdown, warning messages are displayed 114on the terminals of all users logged in. Five minutes before 115shutdown, or immediately if shutdown is in less than 5 minutes, 116logins are disabled by creating 117.Pa /etc/nologin 118and copying the 119warning message there. If this file exists when a user attempts to 120log in, 121.Xr login 1 122prints its contents and exits. The file is 123removed just before 124.Nm shutdown 125exits. 126.Pp 127At shutdown time a message is written in the system log, containing the 128time of shutdown, who initiated the shutdown and the reason. 129A terminate 130signal is then sent to 131.Xr init 132to bring the system down to single-user state (depending on above 133options). 134The time of the shutdown and the warning message 135are placed in 136.Pa /etc/nologin 137and should be used to 138inform the users about when the system will be back up 139and why it is going down (or anything else). 140.Sh FILES 141.Bl -tag -width /etc/nologin -compact 142.It Pa /etc/nologin 143tells login not to let anyone log in 144.It Pa /fastboot 145tells 146.Xr rc 8 147not to run fsck when rebooting 148.El 149.Sh SEE ALSO 150.Xr login 1 , 151.Xr wall 1 , 152.Xr fastboot 8 , 153.Xr halt 8 , 154.Xr reboot 8 155.Sh BACKWARD COMPATIBILITY 156The hours and minutes in the second time format may be separated by 157a colon (``:'') for backward compatibility. 158.Sh HISTORY 159The 160.Nm 161command appeared in 162.Bx 4.0 . 163