ipfw2 - Fix buffer overflow with large tables
[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 October 23, 2013
33 .Dt SHUTDOWN 8
34 .Os
35 .Sh NAME
36 .Nm shutdown ,
37 .Nm poweroff
38 .Nd "close down the system at a given time"
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl
42 .Oo
43 .Fl h | Fl p |
44 .Fl r | Fl k
45 .Oc
46 .Oo
47 .Fl o
48 .Op Fl n
49 .Oc
50 .Ar time
51 .Op Ar warning-message ...
52 .Nm poweroff
53 .Sh DESCRIPTION
54 The
55 .Nm
56 utility provides an automated shutdown procedure for super-users
57 to nicely notify users when the system is shutting down,
58 saving them from system administrators, hackers, and gurus, who
59 would otherwise not bother with such niceties.
60 .Pp
61 The following options are available:
62 .Bl -tag -width indent
63 .It Fl h
64 The system is halted at the specified
65 .Ar time .
66 .It Fl p
67 The system is halted and the power is turned off
68 (hardware support required)
69 at the specified
70 .Ar time .
71 .It Fl r
72 The system is rebooted at the specified
73 .Ar time .
74 .It Fl k
75 Kick everybody off.
76 The
77 .Fl k
78 option
79 does not actually halt the system, but leaves the
80 system multi-user with logins disabled (for all but super-user).
81 .It Fl o
82 If one of the
83 .Fl h ,
84 .Fl p
85 or
86 .Fl r
87 is specified,
88 .Nm
89 will execute
90 .Xr halt 8
91 or
92 .Xr reboot 8
93 instead of sending signal to
94 .Xr init 8 .
95 .It Fl n
96 If the
97 .Fl o
98 is specified, prevent the file system cache from being flushed by passing
99 .Fl n
100 option to
101 .Xr halt 8
102 or
103 .Xr reboot 8 .
104 This option should probably not be used.
105 .It Ar time
106 .Ar Time
107 is the time at which
108 .Nm
109 will bring the system down and
110 may be the word
111 .Ar now
112 (indicating an immediate shutdown) or
113 specify a future time in one of two formats:
114 .Ar +number ,
115 or
116 .Ar yymmddhhmm ,
117 where the year, month, and day may be defaulted
118 to the current system values.  The first form brings the system down in
119 .Ar number
120 minutes and the second at the absolute time specified.
121 .It Ar warning-message
122 Any other arguments comprise the warning message that is broadcast
123 to users currently logged into the system.
124 .It Fl
125 If
126 .Sq Fl
127 is supplied as an option, the warning message is read from the standard
128 input.
129 .El
130 .Pp
131 At intervals, becoming more frequent as apocalypse approaches
132 and starting at ten hours before shutdown, warning messages are displayed
133 on the terminals of all users logged in.  Five minutes before
134 shutdown, or immediately if shutdown is in less than 5 minutes,
135 logins are disabled by creating
136 .Pa /var/run/nologin
137 and copying the
138 warning message there.  If this file exists when a user attempts to
139 log in,
140 .Xr login 1
141 prints its contents and exits.  The file is
142 removed just before
143 .Nm
144 exits.
145 .Pp
146 At shutdown time a message is written to the system log, containing the
147 time of shutdown, the person who initiated the shutdown and the reason.
148 Corresponding signal is then sent to
149 .Xr init 8
150 to respectively halt, reboot or bring the system down to single-user state
151 (depending on the above options).
152 The time of the shutdown and the warning message
153 are placed in
154 .Pa /var/run/nologin
155 and should be used to
156 inform the users about when the system will be back up
157 and why it is going down (or anything else).
158 .Pp
159 A scheduled shutdown can be canceled by killing the
160 .Nm
161 process (a
162 .Dv SIGTERM
163 should suffice).
164 The
165 .Pa /var/run/nologin
166 file that
167 .Nm
168 created will be removed automatically.
169 .Pp
170 Calling
171 .Dq Nm poweroff
172 is equivalent to running:
173 .Bd -literal -offset indent
174 shutdown -p now
175 .Ed
176 .Sh FILES
177 .Bl -tag -width /var/run/nologin -compact
178 .It Pa /var/run/nologin
179 tells login not to let anyone log in
180 .El
181 .Sh BACKWARD COMPATIBILITY
182 The hours and minutes in the second time format may be separated by
183 a colon (``:'') for backward compatibility.
184 .Sh SEE ALSO
185 .Xr kill 1 ,
186 .Xr login 1 ,
187 .Xr wall 1 ,
188 .Xr nologin 5 ,
189 .Xr halt 8 ,
190 .Xr init 8 ,
191 .Xr reboot 8
192 .Sh HISTORY
193 The
194 .Nm
195 utility appeared in
196 .Bx 4.0 .