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