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