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