Correct BSD License clause numbering from 1-2-4 to 1-2-3.
[dragonfly.git] / sbin / shutdown / shutdown.8
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. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)shutdown.8  8.2 (Berkeley) 4/27/95
29 .\" $FreeBSD: src/sbin/shutdown/shutdown.8,v 1.12.2.5 2003/02/23 21:17:43 trhodes Exp $
30 .\" $DragonFly: src/sbin/shutdown/shutdown.8,v 1.3 2006/02/17 19:33:33 swildner Exp $
31 .\"
32 .Dd December 11, 1998
33 .Dt SHUTDOWN 8
34 .Os
35 .Sh NAME
36 .Nm shutdown
37 .Nd "close down the system at a given time"
38 .Sh SYNOPSIS
39 .Nm
40 .Op Fl
41 .Oo
42 .Fl h | Fl p |
43 .Fl r | Fl k
44 .Oc
45 .Oo
46 .Fl o
47 .Op Fl n
48 .Oc
49 .Ar time
50 .Op Ar warning-message ...
51 .Sh DESCRIPTION
52 The
53 .Nm
54 utility provides an automated shutdown procedure for super-users
55 to nicely notify users when the system is shutting down,
56 saving them from system administrators, hackers, and gurus, who
57 would otherwise not bother with such niceties.
58 .Pp
59 The following options are available:
60 .Bl -tag -width indent
61 .It Fl h
62 The system is halted at the specified
63 .Ar time .
64 .It Fl p
65 The system is halted and the power is turned off
66 (hardware support required)
67 at the specified
68 .Ar time .
69 .It Fl r
70 The system is rebooted at the specified
71 .Ar time .
72 .It Fl k
73 Kick everybody off.
74 The
75 .Fl k
76 option
77 does not actually halt the system, but leaves the
78 system multi-user with logins disabled (for all but super-user).
79 .It Fl o
80 If one of the
81 .Fl h ,
82 .Fl p
83 or
84 .Fl r
85 is specified,
86 .Nm
87 will execute
88 .Xr halt 8
89 or
90 .Xr reboot 8
91 instead of sending signal to
92 .Xr init 8 .
93 .It Fl n
94 If the
95 .Fl o
96 is specified, prevent the file system cache from being flushed by passing
97 .Fl n
98 option to
99 .Xr halt 8
100 or
101 .Xr reboot 8 .
102 This option should probably not be used.
103 .It Ar time
104 .Ar Time
105 is the time at which
106 .Nm
107 will bring the system down and
108 may be the word
109 .Ar now
110 (indicating an immediate shutdown) or
111 specify a future time in one of two formats:
112 .Ar +number ,
113 or
114 .Ar yymmddhhmm ,
115 where the year, month, and day may be defaulted
116 to the current system values.  The first form brings the system down in
117 .Ar number
118 minutes and the second at the absolute time specified.
119 .It Ar warning-message
120 Any other arguments comprise the warning message that is broadcast
121 to users currently logged into the system.
122 .It Fl
123 If
124 .Sq Fl
125 is supplied as an option, the warning message is read from the standard
126 input.
127 .El
128 .Pp
129 At intervals, becoming more frequent as apocalypse approaches
130 and starting at ten hours before shutdown, warning messages are displayed
131 on the terminals of all users logged in.  Five minutes before
132 shutdown, or immediately if shutdown is in less than 5 minutes,
133 logins are disabled by creating
134 .Pa /var/run/nologin
135 and copying the
136 warning message there.  If this file exists when a user attempts to
137 log in,
138 .Xr login 1
139 prints its contents and exits.  The file is
140 removed just before
141 .Nm
142 exits.
143 .Pp
144 At shutdown time a message is written to the system log, containing the
145 time of shutdown, the person who initiated the shutdown and the reason.
146 Corresponding signal is then sent to
147 .Xr init 8
148 to respectively halt, reboot or bring the system down to single-user state
149 (depending on the above options).
150 The time of the shutdown and the warning message
151 are placed in
152 .Pa /var/run/nologin
153 and should be used to
154 inform the users about when the system will be back up
155 and why it is going down (or anything else).
156 .Pp
157 A scheduled shutdown can be canceled by killing the
158 .Nm
159 process (a
160 .Dv SIGTERM
161 should suffice).
162 The
163 .Pa /var/run/nologin
164 file that
165 .Nm
166 created will be removed automatically.
167 .Sh FILES
168 .Bl -tag -width /var/run/nologin -compact
169 .It Pa /var/run/nologin
170 tells login not to let anyone log in
171 .El
172 .Sh BACKWARD COMPATIBILITY
173 The hours and minutes in the second time format may be separated by
174 a colon (``:'') for backward compatibility.
175 .Sh SEE ALSO
176 .Xr kill 1 ,
177 .Xr login 1 ,
178 .Xr wall 1 ,
179 .Xr nologin 5 ,
180 .Xr halt 8 ,
181 .Xr init 8 ,
182 .Xr reboot 8
183 .Sh HISTORY
184 The
185 .Nm
186 utility appeared in
187 .Bx 4.0 .