xref: /netbsd-src/sbin/shutdown/shutdown.8 (revision fdecd6a253f999ae92b139670d9e15cc9df4497c)
1.\"	$NetBSD: shutdown.8,v 1.7 1997/07/09 02:39:37 jtk Exp $
2.\"
3.\" Copyright (c) 1988, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     @(#)shutdown.8	8.1 (Berkeley) 6/5/93
35.\"
36.Dd June 5, 1993
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 fhkrnd
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 Fl d
89.Nm
90will pass the
91.Fl d
92and
93.Fl r
94flags to
95.Xr reboot 8
96to request a forced crash dump and reboot.
97.It Ar time
98.Ar Time
99is the time at which
100.Nm
101will bring the system down and
102may be the word
103.Ar now
104(indicating an immediate shutdown) or
105specify a future time in one of two formats:
106.Ar +number ,
107or
108.Ar yymmddhhmm ,
109where the year, month, and day may be defaulted
110to the current system values.  The first form brings the system down in
111.Ar number
112minutes and the second at the absolute time specified.
113.It Ar warning-message
114Any other arguments comprise the warning message that is broadcast
115to users currently logged into the system.
116.It Fl
117If
118.Ql Fl
119is supplied as an option, the warning message is read from the standard
120input.
121.El
122.Pp
123At intervals, becoming more frequent as apocalypse approaches
124and starting at ten hours before shutdown, warning messages are displayed
125on the terminals of all users logged in.  Five minutes before
126shutdown, or immediately if shutdown is in less than 5 minutes,
127logins are disabled by creating
128.Pa /etc/nologin
129and copying the
130warning message there.  If this file exists when a user attempts to
131log in,
132.Xr login 1
133prints its contents and exits.  The file is
134removed just before
135.Nm shutdown
136exits.
137.Pp
138At shutdown time a message is written in the system log, containing the
139time of shutdown, who initiated the shutdown and the reason.
140A terminate
141signal is then sent to
142.Xr init
143to bring the system down to single-user state (depending on above
144options).
145The time of the shutdown and the warning message
146are placed in
147.Pa /etc/nologin
148and should be used to
149inform the users about when the system will be back up
150and why it is going down (or anything else).
151.Sh FILES
152.Bl -tag -width /etc/nologin -compact
153.It Pa /etc/nologin
154tells login not to let anyone log in
155.It Pa /fastboot
156tells
157.Xr rc 8
158not to run fsck when rebooting
159.El
160.Sh SEE ALSO
161.Xr login 1 ,
162.Xr wall 1 ,
163.Xr fastboot 8 ,
164.Xr halt 8 ,
165.Xr reboot 8
166.Sh BACKWARD COMPATIBILITY
167The hours and minutes in the second time format may be separated by
168a colon (``:'') for backward compatibility.
169.Sh HISTORY
170The
171.Nm
172command appeared in
173.Bx 4.0 .
174