xref: /freebsd/sbin/shutdown/shutdown.8 (revision 629e80effb830c03e8e3d994c8f0da9a586bdaed)
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.\" 3. All advertising materials mentioning features or use of this software
138fae3551SRodney W. Grimes.\"    must display the following acknowledgement:
148fae3551SRodney W. Grimes.\"	This product includes software developed by the University of
158fae3551SRodney W. Grimes.\"	California, Berkeley and its contributors.
168fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
178fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
188fae3551SRodney W. Grimes.\"    without specific prior written permission.
198fae3551SRodney W. Grimes.\"
208fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
218fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
248fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
258fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
268fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
278fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
288fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
298fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
308fae3551SRodney W. Grimes.\" SUCH DAMAGE.
318fae3551SRodney W. Grimes.\"
32502a3cc9SBruce Evans.\"     @(#)shutdown.8	8.2 (Berkeley) 4/27/95
337f3dea24SPeter Wemm.\" $FreeBSD$
348fae3551SRodney W. Grimes.\"
35b24f6405SRuslan Ermilov.Dd December 11, 1998
368fae3551SRodney W. Grimes.Dt SHUTDOWN 8
379fe48c6eSRuslan Ermilov.Os
388fae3551SRodney W. Grimes.Sh NAME
398fae3551SRodney W. Grimes.Nm shutdown
408fae3551SRodney W. Grimes.Nd "close down the system at a given time"
418fae3551SRodney W. Grimes.Sh SYNOPSIS
427c7fb079SRuslan Ermilov.Nm
438fae3551SRodney W. Grimes.Op Fl
4435cd460fSRuslan Ermilov.Oo
4535cd460fSRuslan Ermilov.Fl h | Fl p |
4635cd460fSRuslan Ermilov.Fl r | Fl k
4735cd460fSRuslan Ermilov.Oc
4835cd460fSRuslan Ermilov.Oo
4935cd460fSRuslan Ermilov.Fl o
5035cd460fSRuslan Ermilov.Op Fl n
5135cd460fSRuslan Ermilov.Oc
528fae3551SRodney W. Grimes.Ar time
538fae3551SRodney W. Grimes.Op Ar warning-message ...
548fae3551SRodney W. Grimes.Sh DESCRIPTION
55629e80efSPhilippe CharnierThe
56629e80efSPhilippe Charnier.Nm
57629e80efSPhilippe Charnierutility provides an automated shutdown procedure for super-users
588fae3551SRodney W. Grimesto nicely notify users when the system is shutting down,
598fae3551SRodney W. Grimessaving them from system administrators, hackers, and gurus, who
608fae3551SRodney W. Grimeswould otherwise not bother with such niceties.
618fae3551SRodney W. Grimes.Pp
62d3714863SPhilippe CharnierThe following options are available:
63d3714863SPhilippe Charnier.Bl -tag -width indent
648fae3551SRodney W. Grimes.It Fl h
658fae3551SRodney W. GrimesThe system is halted at the specified
6635cd460fSRuslan Ermilov.Ar time .
6735cd460fSRuslan Ermilov.It Fl p
6835cd460fSRuslan ErmilovThe system is halted and the power is turned off
69c4d9468eSRuslan Ermilov(hardware support required)
7035cd460fSRuslan Ermilovat the specified
7135cd460fSRuslan Ermilov.Ar time .
7235cd460fSRuslan Ermilov.It Fl r
7335cd460fSRuslan ErmilovThe system is rebooted at the specified
7435cd460fSRuslan Ermilov.Ar time .
758fae3551SRodney W. Grimes.It Fl k
768fae3551SRodney W. GrimesKick everybody off.
778fae3551SRodney W. GrimesThe
788fae3551SRodney W. Grimes.Fl k
798fae3551SRodney W. Grimesoption
808fae3551SRodney W. Grimesdoes not actually halt the system, but leaves the
818fae3551SRodney W. Grimessystem multi-user with logins disabled (for all but super-user).
8235cd460fSRuslan Ermilov.It Fl o
8335cd460fSRuslan ErmilovIf one of the
8435cd460fSRuslan Ermilov.Fl h ,
8535cd460fSRuslan Ermilov.Fl p
8635cd460fSRuslan Ermilovor
8735cd460fSRuslan Ermilov.Fl r
8835cd460fSRuslan Ermilovis specified,
8935cd460fSRuslan Ermilov.Nm
9035cd460fSRuslan Ermilovwill execute
9135cd460fSRuslan Ermilov.Xr halt 8
9235cd460fSRuslan Ermilovor
938fae3551SRodney W. Grimes.Xr reboot 8
9435cd460fSRuslan Ermilovinstead of sending signal to
9535cd460fSRuslan Ermilov.Xr init 8 .
9635cd460fSRuslan Ermilov.It Fl n
9735cd460fSRuslan ErmilovIf the
9835cd460fSRuslan Ermilov.Fl o
9935cd460fSRuslan Ermilovis specified, prevent the filesystem cache from being flushed by passing
10035cd460fSRuslan Ermilov.Fl n
10135cd460fSRuslan Ermilovoption to
10235cd460fSRuslan Ermilov.Xr halt 8
10335cd460fSRuslan Ermilovor
10435cd460fSRuslan Ermilov.Xr reboot 8 .
10535cd460fSRuslan ErmilovThis option should probably not be used.
1068fae3551SRodney W. Grimes.It Ar time
1078fae3551SRodney W. Grimes.Ar Time
1088fae3551SRodney W. Grimesis the time at which
109d3714863SPhilippe Charnier.Nm
1108fae3551SRodney W. Grimeswill bring the system down and
1118fae3551SRodney W. Grimesmay be the word
1128fae3551SRodney W. Grimes.Ar now
1138fae3551SRodney W. Grimes(indicating an immediate shutdown) or
1148fae3551SRodney W. Grimesspecify a future time in one of two formats:
1158fae3551SRodney W. Grimes.Ar +number ,
1168fae3551SRodney W. Grimesor
1178fae3551SRodney W. Grimes.Ar yymmddhhmm ,
1188fae3551SRodney W. Grimeswhere the year, month, and day may be defaulted
1198fae3551SRodney W. Grimesto the current system values.  The first form brings the system down in
1208fae3551SRodney W. Grimes.Ar number
1218fae3551SRodney W. Grimesminutes and the second at the absolute time specified.
1228fae3551SRodney W. Grimes.It Ar warning-message
1238fae3551SRodney W. GrimesAny other arguments comprise the warning message that is broadcast
1248fae3551SRodney W. Grimesto users currently logged into the system.
1258fae3551SRodney W. Grimes.It Fl
1268fae3551SRodney W. GrimesIf
1278fae3551SRodney W. Grimes.Ql Fl
1288fae3551SRodney W. Grimesis supplied as an option, the warning message is read from the standard
1298fae3551SRodney W. Grimesinput.
1308fae3551SRodney W. Grimes.El
1318fae3551SRodney W. Grimes.Pp
1328fae3551SRodney W. GrimesAt intervals, becoming more frequent as apocalypse approaches
1338fae3551SRodney W. Grimesand starting at ten hours before shutdown, warning messages are displayed
1348fae3551SRodney W. Grimeson the terminals of all users logged in.  Five 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
1398fae3551SRodney W. Grimeswarning message there.  If this file exists when a user attempts to
1408fae3551SRodney W. Grimeslog in,
1418fae3551SRodney W. Grimes.Xr login 1
1428fae3551SRodney W. Grimesprints its contents and exits.  The file is
1438fae3551SRodney W. Grimesremoved just before
144d3714863SPhilippe Charnier.Nm
1458fae3551SRodney W. Grimesexits.
1468fae3551SRodney W. Grimes.Pp
14735cd460fSRuslan ErmilovAt shutdown time a message is written to the system log, containing the
14835cd460fSRuslan Ermilovtime of shutdown, the person who initiated the shutdown and the reason.
14935cd460fSRuslan ErmilovCorresponding signal is then sent to
150d3714863SPhilippe Charnier.Xr init 8
15135cd460fSRuslan Ermilovto respectively halt, reboot or bring the system down to single-user state
15235cd460fSRuslan Ermilov(depending on the above options).
1538fae3551SRodney W. GrimesThe time of the shutdown and the warning message
1548fae3551SRodney W. Grimesare placed in
15516ceea1bSSatoshi Asami.Pa /var/run/nologin
1568fae3551SRodney W. Grimesand should be used to
1578fae3551SRodney W. Grimesinform the users about when the system will be back up
1588fae3551SRodney W. Grimesand why it is going down (or anything else).
1591f240b4cSDima Dorfman.Pp
1601f240b4cSDima DorfmanA scheduled shutdown can be canceled by killing the
1611f240b4cSDima Dorfman.Nm
1621f240b4cSDima Dorfmanprocess (a
1631f240b4cSDima Dorfman.Dv SIGTERM
1641f240b4cSDima Dorfmanshould suffice).
1651f240b4cSDima DorfmanThe
1661f240b4cSDima Dorfman.Pa /var/run/nologin
1671f240b4cSDima Dorfmanfile that
1681f240b4cSDima Dorfman.Nm
1691f240b4cSDima Dorfmancreated will be removed automatically.
1708fae3551SRodney W. Grimes.Sh FILES
17116ceea1bSSatoshi Asami.Bl -tag -width /var/run/nologin -compact
17216ceea1bSSatoshi Asami.It Pa /var/run/nologin
1738fae3551SRodney W. Grimestells login not to let anyone log in
1748fae3551SRodney W. Grimes.El
1758fae3551SRodney W. Grimes.Sh SEE ALSO
1761f240b4cSDima Dorfman.Xr kill 1 ,
1778fae3551SRodney W. Grimes.Xr login 1 ,
1788fae3551SRodney W. Grimes.Xr wall 1 ,
1798c1d6cc7SMasafumi Max NAKANE.Xr nologin 5 ,
1808fae3551SRodney W. Grimes.Xr halt 8 ,
18135cd460fSRuslan Ermilov.Xr init 8 ,
1828fae3551SRodney W. Grimes.Xr reboot 8
1838fae3551SRodney W. Grimes.Sh BACKWARD COMPATIBILITY
1848fae3551SRodney W. GrimesThe hours and minutes in the second time format may be separated by
1858fae3551SRodney W. Grimesa colon (``:'') for backward compatibility.
1868fae3551SRodney W. Grimes.Sh HISTORY
1878fae3551SRodney W. GrimesThe
1888fae3551SRodney W. Grimes.Nm
189629e80efSPhilippe Charnierutility appeared in
1908fae3551SRodney W. Grimes.Bx 4.0 .
191