18fae3551SRodney W. Grimes.\" Copyright (c) 1988, 1991, 1993 28fae3551SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 38fae3551SRodney W. Grimes.\" 48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions 68fae3551SRodney W. Grimes.\" are met: 78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 88fae3551SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 108fae3551SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 118fae3551SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 128fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors 138fae3551SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 148fae3551SRodney W. Grimes.\" without specific prior written permission. 158fae3551SRodney W. Grimes.\" 168fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 178fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 188fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 198fae3551SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 208fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 218fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 228fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 238fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 248fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 258fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 268fae3551SRodney W. Grimes.\" SUCH DAMAGE. 278fae3551SRodney W. Grimes.\" 28502a3cc9SBruce Evans.\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 297f3dea24SPeter Wemm.\" $FreeBSD$ 308fae3551SRodney W. Grimes.\" 31*6868734cSPawel Jakub Dawidek.Dd December 30, 2010 328fae3551SRodney W. Grimes.Dt SHUTDOWN 8 339fe48c6eSRuslan Ermilov.Os 348fae3551SRodney W. Grimes.Sh NAME 35*6868734cSPawel Jakub Dawidek.Nm shutdown , 36*6868734cSPawel Jakub Dawidek.Nm poweroff 378fae3551SRodney W. Grimes.Nd "close down the system at a given time" 388fae3551SRodney W. Grimes.Sh SYNOPSIS 397c7fb079SRuslan Ermilov.Nm 408fae3551SRodney W. Grimes.Op Fl 4135cd460fSRuslan Ermilov.Oo 4235cd460fSRuslan Ermilov.Fl h | Fl p | 4335cd460fSRuslan Ermilov.Fl r | Fl k 4435cd460fSRuslan Ermilov.Oc 4535cd460fSRuslan Ermilov.Oo 4635cd460fSRuslan Ermilov.Fl o 4735cd460fSRuslan Ermilov.Op Fl n 4835cd460fSRuslan Ermilov.Oc 498fae3551SRodney W. Grimes.Ar time 508fae3551SRodney W. Grimes.Op Ar warning-message ... 51*6868734cSPawel Jakub Dawidek.Nm poweroff 528fae3551SRodney W. Grimes.Sh DESCRIPTION 53629e80efSPhilippe CharnierThe 54629e80efSPhilippe Charnier.Nm 55629e80efSPhilippe Charnierutility provides an automated shutdown procedure for super-users 568fae3551SRodney W. Grimesto nicely notify users when the system is shutting down, 578fae3551SRodney W. Grimessaving them from system administrators, hackers, and gurus, who 588fae3551SRodney W. Grimeswould otherwise not bother with such niceties. 598fae3551SRodney W. Grimes.Pp 60d3714863SPhilippe CharnierThe following options are available: 61d3714863SPhilippe Charnier.Bl -tag -width indent 628fae3551SRodney W. Grimes.It Fl h 638fae3551SRodney W. GrimesThe system is halted at the specified 6435cd460fSRuslan Ermilov.Ar time . 6535cd460fSRuslan Ermilov.It Fl p 6635cd460fSRuslan ErmilovThe system is halted and the power is turned off 67c4d9468eSRuslan Ermilov(hardware support required) 6835cd460fSRuslan Ermilovat the specified 6935cd460fSRuslan Ermilov.Ar time . 7035cd460fSRuslan Ermilov.It Fl r 7135cd460fSRuslan ErmilovThe system is rebooted at the specified 7235cd460fSRuslan Ermilov.Ar time . 738fae3551SRodney W. Grimes.It Fl k 748fae3551SRodney W. GrimesKick everybody off. 758fae3551SRodney W. GrimesThe 768fae3551SRodney W. Grimes.Fl k 778fae3551SRodney W. Grimesoption 788fae3551SRodney W. Grimesdoes not actually halt the system, but leaves the 798fae3551SRodney W. Grimessystem multi-user with logins disabled (for all but super-user). 8035cd460fSRuslan Ermilov.It Fl o 8135cd460fSRuslan ErmilovIf one of the 8235cd460fSRuslan Ermilov.Fl h , 8335cd460fSRuslan Ermilov.Fl p 8435cd460fSRuslan Ermilovor 8535cd460fSRuslan Ermilov.Fl r 8635cd460fSRuslan Ermilovis specified, 8735cd460fSRuslan Ermilov.Nm 8835cd460fSRuslan Ermilovwill execute 8935cd460fSRuslan Ermilov.Xr halt 8 9035cd460fSRuslan Ermilovor 918fae3551SRodney W. Grimes.Xr reboot 8 9235cd460fSRuslan Ermilovinstead of sending signal to 9335cd460fSRuslan Ermilov.Xr init 8 . 9435cd460fSRuslan Ermilov.It Fl n 9535cd460fSRuslan ErmilovIf the 9635cd460fSRuslan Ermilov.Fl o 9735cd460fSRuslan Ermilovis specified, prevent the file system cache from being flushed by passing 9835cd460fSRuslan Ermilov.Fl n 9935cd460fSRuslan Ermilovoption to 10035cd460fSRuslan Ermilov.Xr halt 8 10135cd460fSRuslan Ermilovor 10235cd460fSRuslan Ermilov.Xr reboot 8 . 10335cd460fSRuslan ErmilovThis option should probably not be used. 1048fae3551SRodney W. Grimes.It Ar time 1058fae3551SRodney W. Grimes.Ar Time 1068fae3551SRodney W. Grimesis the time at which 107d3714863SPhilippe Charnier.Nm 1088fae3551SRodney W. Grimeswill bring the system down and 1098fae3551SRodney W. Grimesmay be the word 1108fae3551SRodney W. Grimes.Ar now 1118fae3551SRodney W. Grimes(indicating an immediate shutdown) or 1128fae3551SRodney W. Grimesspecify a future time in one of two formats: 1138fae3551SRodney W. Grimes.Ar +number , 1148fae3551SRodney W. Grimesor 1158fae3551SRodney W. Grimes.Ar yymmddhhmm , 1168fae3551SRodney W. Grimeswhere the year, month, and day may be defaulted 1179806e231SRuslan Ermilovto the current system values. 1189806e231SRuslan ErmilovThe first form brings the system down in 1198fae3551SRodney W. Grimes.Ar number 1208fae3551SRodney W. Grimesminutes and the second at the absolute time specified. 1218fae3551SRodney W. Grimes.It Ar warning-message 1228fae3551SRodney W. GrimesAny other arguments comprise the warning message that is broadcast 1238fae3551SRodney W. Grimesto users currently logged into the system. 1248fae3551SRodney W. Grimes.It Fl 1258fae3551SRodney W. GrimesIf 126463cfa80SRuslan Ermilov.Sq Fl 1278fae3551SRodney W. Grimesis supplied as an option, the warning message is read from the standard 1288fae3551SRodney W. Grimesinput. 1298fae3551SRodney W. Grimes.El 1308fae3551SRodney W. Grimes.Pp 1318fae3551SRodney W. GrimesAt intervals, becoming more frequent as apocalypse approaches 1328fae3551SRodney W. Grimesand starting at ten hours before shutdown, warning messages are displayed 1339806e231SRuslan Ermilovon the terminals of all users logged in. 1349806e231SRuslan ErmilovFive minutes before 1358fae3551SRodney W. Grimesshutdown, or immediately if shutdown is in less than 5 minutes, 1368fae3551SRodney W. Grimeslogins are disabled by creating 13716ceea1bSSatoshi Asami.Pa /var/run/nologin 1388fae3551SRodney W. Grimesand copying the 1399806e231SRuslan Ermilovwarning message there. 1409806e231SRuslan ErmilovIf this file exists when a user attempts to 1418fae3551SRodney W. Grimeslog in, 1428fae3551SRodney W. Grimes.Xr login 1 1439806e231SRuslan Ermilovprints its contents and exits. 1449806e231SRuslan ErmilovThe file is 1458fae3551SRodney W. Grimesremoved just before 146d3714863SPhilippe Charnier.Nm 1478fae3551SRodney W. Grimesexits. 1488fae3551SRodney W. Grimes.Pp 14935cd460fSRuslan ErmilovAt shutdown time a message is written to the system log, containing the 15035cd460fSRuslan Ermilovtime of shutdown, the person who initiated the shutdown and the reason. 15135cd460fSRuslan ErmilovCorresponding signal is then sent to 152d3714863SPhilippe Charnier.Xr init 8 15335cd460fSRuslan Ermilovto respectively halt, reboot or bring the system down to single-user state 15435cd460fSRuslan Ermilov(depending on the above options). 1558fae3551SRodney W. GrimesThe time of the shutdown and the warning message 1568fae3551SRodney W. Grimesare placed in 15716ceea1bSSatoshi Asami.Pa /var/run/nologin 1588fae3551SRodney W. Grimesand should be used to 1598fae3551SRodney W. Grimesinform the users about when the system will be back up 1608fae3551SRodney W. Grimesand why it is going down (or anything else). 1611f240b4cSDima Dorfman.Pp 1621f240b4cSDima DorfmanA scheduled shutdown can be canceled by killing the 1631f240b4cSDima Dorfman.Nm 1641f240b4cSDima Dorfmanprocess (a 1651f240b4cSDima Dorfman.Dv SIGTERM 1661f240b4cSDima Dorfmanshould suffice). 1671f240b4cSDima DorfmanThe 1681f240b4cSDima Dorfman.Pa /var/run/nologin 1691f240b4cSDima Dorfmanfile that 1701f240b4cSDima Dorfman.Nm 1711f240b4cSDima Dorfmancreated will be removed automatically. 1721aa26f52STom Rhodes.Pp 1731aa26f52STom RhodesWhen run without options, the 1741aa26f52STom Rhodes.Nm 1751aa26f52STom Rhodesutility will place the system into single user mode at the 1761aa26f52STom Rhodes.Ar time 1771aa26f52STom Rhodesspecified. 178*6868734cSPawel Jakub Dawidek.Pp 179*6868734cSPawel Jakub DawidekCalling utility as 180*6868734cSPawel Jakub Dawidek.Nm poweroff 181*6868734cSPawel Jakub Dawidekis equivalent of calling: 182*6868734cSPawel Jakub Dawidek.Bd -literal -offset indent 183*6868734cSPawel Jakub Dawidekshutdown -p now 184*6868734cSPawel Jakub Dawidek.Ed 1858fae3551SRodney W. Grimes.Sh FILES 18616ceea1bSSatoshi Asami.Bl -tag -width /var/run/nologin -compact 18716ceea1bSSatoshi Asami.It Pa /var/run/nologin 1888fae3551SRodney W. Grimestells login not to let anyone log in 1898fae3551SRodney W. Grimes.El 1908ee0cef5SRuslan Ermilov.Sh COMPATIBILITY 1918ee0cef5SRuslan ErmilovThe hours and minutes in the second time format may be separated by 1928ee0cef5SRuslan Ermilova colon (``:'') for backward compatibility. 1938fae3551SRodney W. Grimes.Sh SEE ALSO 1941f240b4cSDima Dorfman.Xr kill 1 , 1958fae3551SRodney W. Grimes.Xr login 1 , 1968fae3551SRodney W. Grimes.Xr wall 1 , 1978c1d6cc7SMasafumi Max NAKANE.Xr nologin 5 , 1988fae3551SRodney W. Grimes.Xr halt 8 , 19935cd460fSRuslan Ermilov.Xr init 8 , 2008fae3551SRodney W. Grimes.Xr reboot 8 2018fae3551SRodney W. Grimes.Sh HISTORY 2028fae3551SRodney W. GrimesThe 2038fae3551SRodney W. Grimes.Nm 204629e80efSPhilippe Charnierutility appeared in 2058fae3551SRodney W. Grimes.Bx 4.0 . 206