1*93184c84SSevan Janiyan.\" $NetBSD: shutdown.8,v 1.33 2016/09/14 00:16:31 kre Exp $ 2a06e2ab3SBen Gras.\" 3a06e2ab3SBen Gras.\" Copyright (c) 1988, 1991, 1993 4a06e2ab3SBen Gras.\" The Regents of the University of California. All rights reserved. 5a06e2ab3SBen Gras.\" 6a06e2ab3SBen Gras.\" Redistribution and use in source and binary forms, with or without 7a06e2ab3SBen Gras.\" modification, are permitted provided that the following conditions 8a06e2ab3SBen Gras.\" are met: 9a06e2ab3SBen Gras.\" 1. Redistributions of source code must retain the above copyright 10a06e2ab3SBen Gras.\" notice, this list of conditions and the following disclaimer. 11a06e2ab3SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 12a06e2ab3SBen Gras.\" notice, this list of conditions and the following disclaimer in the 13a06e2ab3SBen Gras.\" documentation and/or other materials provided with the distribution. 14a06e2ab3SBen Gras.\" 3. Neither the name of the University nor the names of its contributors 15a06e2ab3SBen Gras.\" may be used to endorse or promote products derived from this software 16a06e2ab3SBen Gras.\" without specific prior written permission. 17a06e2ab3SBen Gras.\" 18a06e2ab3SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19a06e2ab3SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20a06e2ab3SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21a06e2ab3SBen Gras.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22a06e2ab3SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23a06e2ab3SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24a06e2ab3SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25a06e2ab3SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26a06e2ab3SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27a06e2ab3SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28a06e2ab3SBen Gras.\" SUCH DAMAGE. 29a06e2ab3SBen Gras.\" 30a06e2ab3SBen Gras.\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 31a06e2ab3SBen Gras.\" 32*93184c84SSevan Janiyan.Dd September 12, 2016 33a06e2ab3SBen Gras.Dt SHUTDOWN 8 34a06e2ab3SBen Gras.Os 35a06e2ab3SBen Gras.Sh NAME 36a06e2ab3SBen Gras.Nm shutdown 37a06e2ab3SBen Gras.Nd close down the system at a given time 38a06e2ab3SBen Gras.Sh SYNOPSIS 39a06e2ab3SBen Gras.Nm 40a06e2ab3SBen Gras.Op Fl Ddfhknprvxz 41a06e2ab3SBen Gras.Op Fl b Ar bootstr 42a06e2ab3SBen Gras.Ar time 43a06e2ab3SBen Gras.Op Ar message ... | Ar - 44a06e2ab3SBen Gras.Sh DESCRIPTION 45a06e2ab3SBen Gras.Nm 46a06e2ab3SBen Grasprovides an automated shutdown procedure for super-users 47a06e2ab3SBen Grasto nicely notify users when the system is shutting down, 48a06e2ab3SBen Grassaving them from system administrators, hackers, and gurus, who 49a06e2ab3SBen Graswould otherwise not bother with such niceties. 50a06e2ab3SBen Gras.Pp 51a06e2ab3SBen GrasAvailable friendlinesses: 52a06e2ab3SBen Gras.Bl -tag -width bootstr 53a06e2ab3SBen Gras.It Fl b Ar bootstr 54a06e2ab3SBen GrasThe given 55a06e2ab3SBen Gras.Ar bootstr 56a06e2ab3SBen Grasis passed to 57a06e2ab3SBen Gras.Xr reboot 8 58a06e2ab3SBen Grasfor the benefit of those systems that can pass boot arguments to the 59a06e2ab3SBen Grasfirmware. 60a06e2ab3SBen GrasCurrently, this only affects sun3 and sparc machines. 61a06e2ab3SBen Gras.It Fl d 62a06e2ab3SBen Gras.Nm 63a06e2ab3SBen Graswill pass the 64a06e2ab3SBen Gras.Fl d 65a06e2ab3SBen Grasflag to 66a06e2ab3SBen Gras.Xr reboot 8 67a06e2ab3SBen Grasor 68a06e2ab3SBen Gras.Xr halt 8 69a06e2ab3SBen Grasto request a kernel core dump. 70a06e2ab3SBen GrasIf neither the 71a06e2ab3SBen Gras.Fl h 72a06e2ab3SBen Grasor 73a06e2ab3SBen Gras.Fl r 74a06e2ab3SBen Grasflags are specified, then 75a06e2ab3SBen Gras.Fl d 76a06e2ab3SBen Grasalso implies 77a06e2ab3SBen Gras.Fl r . 78a06e2ab3SBen Gras.It Fl f 79a06e2ab3SBen Gras.Nm 80a06e2ab3SBen Grasarranges, in the manner of 81a06e2ab3SBen Gras.Xr fastboot 8 , 82a06e2ab3SBen Grasfor the file systems 83a06e2ab3SBen Gras.Em not to be 84a06e2ab3SBen Graschecked on reboot. 85a06e2ab3SBen Gras.It Fl h 86a06e2ab3SBen GrasThe system is halted at the specified 87a06e2ab3SBen Gras.Ar time , 88a06e2ab3SBen Grasusing 89a06e2ab3SBen Gras.Xr halt 8 . 90a06e2ab3SBen Gras.It Fl k 91a06e2ab3SBen GrasKick everybody off. 92a06e2ab3SBen GrasThe 93a06e2ab3SBen Gras.Fl k 94a06e2ab3SBen Grasoption 95a06e2ab3SBen Grasdoes not actually halt the system, but leaves the 96a06e2ab3SBen Grassystem multi-user with logins disabled (for all but super-user). 97a06e2ab3SBen Gras.It Fl n 98a06e2ab3SBen GrasPrevent the normal 99a06e2ab3SBen Gras.Xr sync 2 100a06e2ab3SBen Grasbefore stopping. 101a06e2ab3SBen Gras.It Fl p 102a06e2ab3SBen GrasThe system is powered down at the specified 103a06e2ab3SBen Gras.Ar time , 104a06e2ab3SBen Grasusing 105a06e2ab3SBen Gras.Xr poweroff 8 . 106a06e2ab3SBen GrasIf the powerdown fails, or the system does not support software powerdown, 107a06e2ab3SBen Grasthe system will simply halt instead. 108a06e2ab3SBen Gras.It Fl r 109a06e2ab3SBen GrasThe system is rebooted at the specified 110a06e2ab3SBen Gras.Ar time , 111a06e2ab3SBen Grasusing 112a06e2ab3SBen Gras.Xr reboot 8 . 113a06e2ab3SBen Gras.It Fl v 114a06e2ab3SBen GrasTo enable verbose messages on the console, pass 115a06e2ab3SBen Gras.Fl v 116a06e2ab3SBen Grasto 117a06e2ab3SBen Gras.Xr reboot 8 118a06e2ab3SBen Grasor 119a06e2ab3SBen Gras.Xr halt 8 . 120a06e2ab3SBen Gras.It Fl x 121a06e2ab3SBen GrasTo enable debugging messages on the console, pass 122a06e2ab3SBen Gras.Fl x 123a06e2ab3SBen Grasto 124a06e2ab3SBen Gras.Xr reboot 8 125a06e2ab3SBen Grasor 126a06e2ab3SBen Gras.Xr halt 8 . 127a06e2ab3SBen Gras.It Fl z 128a06e2ab3SBen GrasTo silence some shutdown messages on the console, pass 129a06e2ab3SBen Gras.Fl z 130a06e2ab3SBen Grasto 131a06e2ab3SBen Gras.Xr reboot 8 132a06e2ab3SBen Grasor 133a06e2ab3SBen Gras.Xr halt 8 . 134a06e2ab3SBen Gras.It Fl D 135a06e2ab3SBen GrasPrevents 136a06e2ab3SBen Gras.Nm 137a06e2ab3SBen Grasfrom detaching from the tty with 138a06e2ab3SBen Gras.Xr fork 2 Ns / 139a06e2ab3SBen Gras.Xr exit 3 . 140a06e2ab3SBen Gras.It Ar time 141a06e2ab3SBen Gras.Ar Time 142a06e2ab3SBen Grasis the time at which 143a06e2ab3SBen Gras.Nm 144a06e2ab3SBen Graswill bring the system down and 145a06e2ab3SBen Grasmay be the word 146a06e2ab3SBen Gras.Ar now 147a06e2ab3SBen Grasor a future time in one of two formats: 148a06e2ab3SBen Gras.Ar +number , 149a06e2ab3SBen Grasor 150a06e2ab3SBen Gras.Ar [[[[[cc]yy]mm]dd]hh]mm , 151a06e2ab3SBen Graswhere the century, year, month, day, and hour may be defaulted 152a06e2ab3SBen Grasto the current system values. 153a06e2ab3SBen GrasThe first form brings the system down 154a06e2ab3SBen Gras.Ar number 155a06e2ab3SBen Grasminutes from the current time; the second brings the system down at the 156a06e2ab3SBen Grasabsolute time specified. 157a06e2ab3SBen GrasIf the century is not specified, it defaults to 1900 for years between 69 158a06e2ab3SBen Grasand 99, or 2000 for years between 0 and 68. 159a06e2ab3SBen GrasA leading zero in the 160a06e2ab3SBen Gras.Dq yy 161a06e2ab3SBen Grasvalue is 162a06e2ab3SBen Gras.Em not 163a06e2ab3SBen Grasoptional. 164a06e2ab3SBen Gras.It Ar message ... 165a06e2ab3SBen GrasAny other arguments comprise the warning message that is broadcast 166a06e2ab3SBen Grasto users currently logged into the system. 167a06e2ab3SBen Gras.It Ar - 168a06e2ab3SBen GrasIf 169a06e2ab3SBen Gras.Ar - 170a06e2ab3SBen Grasis supplied as the only argument after the time, the warning message is read 171a06e2ab3SBen Grasfrom the standard input. 172a06e2ab3SBen Gras.El 173a06e2ab3SBen Gras.Sh BEHAVIOR 174a06e2ab3SBen Gras.Pp 175a06e2ab3SBen GrasAt intervals, becoming more frequent as apocalypse approaches 176a06e2ab3SBen Grasand starting at ten hours before shutdown, warning messages are displayed 177a06e2ab3SBen Grason the terminals of all users logged in. 178a06e2ab3SBen GrasFive minutes before shutdown, or immediately if shutdown is in less 179a06e2ab3SBen Grasthan 5 minutes, logins are disabled by creating 180a06e2ab3SBen Gras.Pa /etc/nologin 181a06e2ab3SBen Grasand copying the warning message there. 182a06e2ab3SBen GrasIf this file exists when a user attempts to log in, 183a06e2ab3SBen Gras.Xr login 1 184a06e2ab3SBen Grasprints its contents and exits. 185a06e2ab3SBen GrasThe file is removed just before 186a06e2ab3SBen Gras.Nm 187a06e2ab3SBen Grasexits. 188a06e2ab3SBen Gras.Pp 189a06e2ab3SBen GrasAt shutdown time, a message is written in the system log containing the 190a06e2ab3SBen Grastime of shutdown, who initiated the shutdown, and the reason. 191a06e2ab3SBen GrasNext a message is printed announcing the start of the system shutdown hooks. 192a06e2ab3SBen GrasThen the shutdown hooks in 193a06e2ab3SBen Gras.Pa /etc/rc.shutdown 194a06e2ab3SBen Grasare run, and a message is printed indicating that they have completed. 195a06e2ab3SBen GrasAfter a short delay, 196a06e2ab3SBen Gras.Nm 197a06e2ab3SBen Grasruns 198a06e2ab3SBen Gras.Xr halt 8 199a06e2ab3SBen Grasor 200a06e2ab3SBen Gras.Xr reboot 8 , 201a06e2ab3SBen Grasor sends a terminate 202a06e2ab3SBen Grassignal to 203a06e2ab3SBen Gras.Xr init 8 204a06e2ab3SBen Grasto bring the system down to single-user mode, depending on the choice 205a06e2ab3SBen Grasof options. 206a06e2ab3SBen Gras.Pp 207a06e2ab3SBen GrasThe time of the shutdown and the warning message are placed in 208a06e2ab3SBen Gras.Pa /etc/nologin 209a06e2ab3SBen Grasand should be used to tell the users why the system is 210a06e2ab3SBen Grasgoing down, when it will be back up, and to share any other pertinent 211a06e2ab3SBen Grasinformation. 212a06e2ab3SBen Gras.Sh FILES 213a06e2ab3SBen Gras.Bl -tag -width /etc/rc.shutdown -compact 214a06e2ab3SBen Gras.It Pa /etc/nologin 215a06e2ab3SBen Grastells 216a06e2ab3SBen Gras.Xr login 1 217a06e2ab3SBen Grasnot to let anyone log in 218a06e2ab3SBen Gras.It Pa /fastboot 219a06e2ab3SBen Grastells 220a06e2ab3SBen Gras.Xr rc 8 221a06e2ab3SBen Grasnot to run 222a06e2ab3SBen Gras.Xr fsck 8 223a06e2ab3SBen Graswhen rebooting 224a06e2ab3SBen Gras.It Pa /etc/rc.shutdown 225a06e2ab3SBen GrasSystem shutdown commands 226a06e2ab3SBen Gras.El 227a06e2ab3SBen Gras.Sh SEE ALSO 228a06e2ab3SBen Gras.Xr login 1 , 229a06e2ab3SBen Gras.Xr wall 1 , 230a06e2ab3SBen Gras.Xr fastboot 8 , 231a06e2ab3SBen Gras.Xr halt 8 , 232a06e2ab3SBen Gras.Xr init 8 , 233a06e2ab3SBen Gras.Xr poweroff 8 , 234a06e2ab3SBen Gras.Xr reboot 8 , 235a06e2ab3SBen Gras.Xr rescue 8 236a06e2ab3SBen Gras.Sh BACKWARD COMPATIBILITY 237a06e2ab3SBen GrasThe hours and minutes in the second time format may be separated by 238a06e2ab3SBen Grasa colon (``:'') for backward compatibility. 239a06e2ab3SBen Gras.Sh HISTORY 240*93184c84SSevan JaniyanA 241a06e2ab3SBen Gras.Nm 242*93184c84SSevan Janiyancommand was originally written by Ian Johnstone for UNSW's modified 243*93184c84SSevan Janiyan.At "6th Edn" , 244*93184c84SSevan Janiyanmodified, and then incorporated in 245*93184c84SSevan Janiyan.Bx 4.1 . 246