xref: /freebsd/sbin/shutdown/shutdown.8 (revision c7d73a4d23fe6884a49b0a4eb8734aa8a153bef4)
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*c7d73a4dSGleb Kurtsou.Dd December 15, 2014
328fae3551SRodney W. Grimes.Dt SHUTDOWN 8
339fe48c6eSRuslan Ermilov.Os
348fae3551SRodney W. Grimes.Sh NAME
356868734cSPawel Jakub Dawidek.Nm shutdown ,
366868734cSPawel 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 ...
516868734cSPawel 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
8654d3d7c0SGlen Barberoptions are specified,
8735cd460fSRuslan Ermilov.Nm
8835cd460fSRuslan Ermilovwill execute
8935cd460fSRuslan Ermilov.Xr halt 8
9035cd460fSRuslan Ermilovor
918fae3551SRodney W. Grimes.Xr reboot 8
9254d3d7c0SGlen Barberinstead of sending a signal to
9335cd460fSRuslan Ermilov.Xr init 8 .
9435cd460fSRuslan Ermilov.It Fl n
9535cd460fSRuslan ErmilovIf the
9635cd460fSRuslan Ermilov.Fl o
9754d3d7c0SGlen Barberoption is specified, prevent the file system cache from being flushed by passing
9835cd460fSRuslan Ermilov.Fl n
9954d3d7c0SGlen Barberto
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
10954d3d7c0SGlen Barbermay be the case-insensitive word
1108fae3551SRodney W. Grimes.Ar now
1118fae3551SRodney W. Grimes(indicating an immediate shutdown) or
11254d3d7c0SGlen Barbera 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.
121*c7d73a4dSGleb Kurtsou.Ar +number
122*c7d73a4dSGleb Kurtsoumay be specified in units other than minutes by appending the corresponding
123*c7d73a4dSGleb Kurtsousuffix:
124*c7d73a4dSGleb Kurtsou.Dq Li s ,
125*c7d73a4dSGleb Kurtsou.Dq Li sec ,
126*c7d73a4dSGleb Kurtsou.Dq Li m ,
127*c7d73a4dSGleb Kurtsou.Dq Li min .
128*c7d73a4dSGleb Kurtsou.Dq Li h ,
129*c7d73a4dSGleb Kurtsou.Dq Li hour .
1308fae3551SRodney W. Grimes.It Ar warning-message
1318fae3551SRodney W. GrimesAny other arguments comprise the warning message that is broadcast
1328fae3551SRodney W. Grimesto users currently logged into the system.
1338fae3551SRodney W. Grimes.It Fl
1348fae3551SRodney W. GrimesIf
135463cfa80SRuslan Ermilov.Sq Fl
1368fae3551SRodney W. Grimesis supplied as an option, the warning message is read from the standard
1378fae3551SRodney W. Grimesinput.
1388fae3551SRodney W. Grimes.El
1398fae3551SRodney W. Grimes.Pp
1408fae3551SRodney W. GrimesAt intervals, becoming more frequent as apocalypse approaches
1418fae3551SRodney W. Grimesand starting at ten hours before shutdown, warning messages are displayed
1429806e231SRuslan Ermilovon the terminals of all users logged in.
1439806e231SRuslan ErmilovFive minutes before
1448fae3551SRodney W. Grimesshutdown, or immediately if shutdown is in less than 5 minutes,
1458fae3551SRodney W. Grimeslogins are disabled by creating
14616ceea1bSSatoshi Asami.Pa /var/run/nologin
1478fae3551SRodney W. Grimesand copying the
1489806e231SRuslan Ermilovwarning message there.
1499806e231SRuslan ErmilovIf this file exists when a user attempts to
1508fae3551SRodney W. Grimeslog in,
1518fae3551SRodney W. Grimes.Xr login 1
1529806e231SRuslan Ermilovprints its contents and exits.
1539806e231SRuslan ErmilovThe file is
1548fae3551SRodney W. Grimesremoved just before
155d3714863SPhilippe Charnier.Nm
1568fae3551SRodney W. Grimesexits.
1578fae3551SRodney W. Grimes.Pp
15835cd460fSRuslan ErmilovAt shutdown time a message is written to the system log, containing the
15935cd460fSRuslan Ermilovtime of shutdown, the person who initiated the shutdown and the reason.
16054d3d7c0SGlen BarberThe corresponding signal is then sent to
161d3714863SPhilippe Charnier.Xr init 8
16235cd460fSRuslan Ermilovto respectively halt, reboot or bring the system down to single-user state
16335cd460fSRuslan Ermilov(depending on the above options).
1648fae3551SRodney W. GrimesThe time of the shutdown and the warning message
1658fae3551SRodney W. Grimesare placed in
16616ceea1bSSatoshi Asami.Pa /var/run/nologin
1678fae3551SRodney W. Grimesand should be used to
1688fae3551SRodney W. Grimesinform the users about when the system will be back up
1698fae3551SRodney W. Grimesand why it is going down (or anything else).
1701f240b4cSDima Dorfman.Pp
1711f240b4cSDima DorfmanA scheduled shutdown can be canceled by killing the
1721f240b4cSDima Dorfman.Nm
1731f240b4cSDima Dorfmanprocess (a
1741f240b4cSDima Dorfman.Dv SIGTERM
1751f240b4cSDima Dorfmanshould suffice).
1761f240b4cSDima DorfmanThe
1771f240b4cSDima Dorfman.Pa /var/run/nologin
1781f240b4cSDima Dorfmanfile that
1791f240b4cSDima Dorfman.Nm
1801f240b4cSDima Dorfmancreated will be removed automatically.
1811aa26f52STom Rhodes.Pp
1821aa26f52STom RhodesWhen run without options, the
1831aa26f52STom Rhodes.Nm
1841aa26f52STom Rhodesutility will place the system into single user mode at the
1851aa26f52STom Rhodes.Ar time
1861aa26f52STom Rhodesspecified.
1876868734cSPawel Jakub Dawidek.Pp
18854d3d7c0SGlen BarberCalling
18954d3d7c0SGlen Barber.Dq Nm poweroff
19054d3d7c0SGlen Barberis equivalent to running:
1916868734cSPawel Jakub Dawidek.Bd -literal -offset indent
1926868734cSPawel Jakub Dawidekshutdown -p now
1936868734cSPawel Jakub Dawidek.Ed
1948fae3551SRodney W. Grimes.Sh FILES
19516ceea1bSSatoshi Asami.Bl -tag -width /var/run/nologin -compact
19616ceea1bSSatoshi Asami.It Pa /var/run/nologin
19754d3d7c0SGlen Barbertells
19854d3d7c0SGlen Barber.Xr login 1
19954d3d7c0SGlen Barbernot to let anyone log in
2008fae3551SRodney W. Grimes.El
2017cf62795SJoel Dahl.Sh EXAMPLES
2027cf62795SJoel DahlReboot the system in 30 minutes and display a warning message on the terminals
2037cf62795SJoel Dahlof all users currently logged in:
2047cf62795SJoel Dahl.Pp
2057cf62795SJoel Dahl.Dl # shutdown -r +30 \&"System will reboot\&"
2068ee0cef5SRuslan Ermilov.Sh COMPATIBILITY
2078ee0cef5SRuslan ErmilovThe hours and minutes in the second time format may be separated by
2088ee0cef5SRuslan Ermilova colon (``:'') for backward compatibility.
2098fae3551SRodney W. Grimes.Sh SEE ALSO
2101f240b4cSDima Dorfman.Xr kill 1 ,
2118fae3551SRodney W. Grimes.Xr login 1 ,
2128fae3551SRodney W. Grimes.Xr wall 1 ,
2138c1d6cc7SMasafumi Max NAKANE.Xr nologin 5 ,
2148fae3551SRodney W. Grimes.Xr halt 8 ,
21535cd460fSRuslan Ermilov.Xr init 8 ,
2168fae3551SRodney W. Grimes.Xr reboot 8
2178fae3551SRodney W. Grimes.Sh HISTORY
2188fae3551SRodney W. GrimesThe
2198fae3551SRodney W. Grimes.Nm
220629e80efSPhilippe Charnierutility appeared in
2218fae3551SRodney W. Grimes.Bx 4.0 .
222