snj doesn't like my accent, so use proper English month names.
[netbsd-mini2440.git] / sbin / shutdown / shutdown.8
blob9e0cf9cd3e20186346d97ae062404a72667c3c46
1 .\"     $NetBSD: shutdown.8,v 1.27 2008/02/09 04:09:22 dholland 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. Neither the name of the University nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .\"     @(#)shutdown.8  8.2 (Berkeley) 4/27/95
31 .\"
32 .Dd October 21, 2008
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 b Ar bootstr
41 .Op Fl Ddfhknpr
42 .Ar time
43 .Op Ar message ... | Ar -
44 .Sh DESCRIPTION
45 .Nm
46 provides an automated shutdown procedure for super-users
47 to nicely notify users when the system is shutting down,
48 saving them from system administrators, hackers, and gurus, who
49 would otherwise not bother with such niceties.
50 .Pp
51 Available friendlinesses:
52 .Bl -tag -width bootstr
53 .It Fl b Ar bootstr
54 The given
55 .Ar bootstr
56 is passed to
57 .Xr reboot 8
58 for the benefit of those systems that can pass boot arguments to the
59 firmware.
60 Currently, this only affects sun3 and sparc machines.
61 .It Fl d
62 .Nm
63 will pass the
64 .Fl d
65 flag to
66 .Xr reboot 8
68 .Xr halt 8
69 to request a kernel core dump.
70 If neither the
71 .Fl h
73 .Fl r
74 flags are specified, then
75 .Fl d
76 also implies
77 .Fl r .
78 .It Fl f
79 .Nm
80 arranges, in the manner of
81 .Xr fastboot 8 ,
82 for the file systems
83 .Em not to be
84 checked on reboot.
85 .It Fl h
86 The system is halted at the specified
87 .Ar time ,
88 using
89 .Xr halt 8 .
90 .It Fl k
91 Kick everybody off.
92 The
93 .Fl k
94 option
95 does not actually halt the system, but leaves the
96 system multi-user with logins disabled (for all but super-user).
97 .It Fl n
98 Prevent the normal
99 .Xr sync 2
100 before stopping.
101 .It Fl p
102 The system is powered down at the specified
103 .Ar time ,
104 using
105 .Xr halt 8 .
106 If the powerdown fails, or the system does not support software powerdown,
107 the system will simply halt instead.
108 .It Fl r
109 The system is rebooted at the specified
110 .Ar time ,
111 using
112 .Xr reboot 8 .
113 .It Fl D
114 Prevents
116 from detaching from the tty with
117 .Xr fork 2 Ns /
118 .Xr exit 3 .
119 .It Ar time
120 .Ar Time
121 is the time at which
123 will bring the system down and
124 may be the word
125 .Ar now
126 or a future time in one of two formats:
127 .Ar +number ,
129 .Ar [[[[[cc]yy]mm]dd]hh]mm ,
130 where the century, year, month, day, and hour may be defaulted
131 to the current system values.
132 The first form brings the system down
133 .Ar number
134 minutes from the current time; the second brings the system down at the
135 absolute time specified.
136 If the century is not specified, it defaults to 1900 for years between 69
137 and 99, or 2000 for years between 0 and 68.
138 A leading zero in the
139 .Dq yy
140 value is
141 .Em not
142 optional.
143 .It Ar message ...
144 Any other arguments comprise the warning message that is broadcast
145 to users currently logged into the system.
146 .It Ar -
148 .Ar -
149 is supplied as the only argument after the time, the warning message is read
150 from the standard input.
152 .Sh BEHAVIOR
154 At intervals, becoming more frequent as apocalypse approaches
155 and starting at ten hours before shutdown, warning messages are displayed
156 on the terminals of all users logged in.
157 Five minutes before shutdown, or immediately if shutdown is in less
158 than 5 minutes, logins are disabled by creating
159 .Pa /etc/nologin
160 and copying the warning message there.
161 If this file exists when a user attempts to log in,
162 .Xr login 1
163 prints its contents and exits.
164 The file is removed just before
166 exits.
168 At shutdown time, a message is written in the system log containing the
169 time of shutdown, who initiated the shutdown, and the reason.
170 Next a message is printed announcing the start of the system shutdown hooks.
171 Then the shutdown hooks in
172 .Pa /etc/rc.shutdown
173 are run, and a message is printed indicating that they have completed.
174 After a short delay,
176 runs
177 .Xr halt 8
179 .Xr reboot 8 ,
180 or sends a terminate
181 signal to
182 .Xr init 8
183 to bring the system down to single-user mode, depending on the choice
184 of options.
186 The time of the shutdown and the warning message are placed in
187 .Pa /etc/nologin
188 and should be used to tell the users why the system is
189 going down, when it will be back up, and to share any other pertinent
190 information.
191 .Sh FILES
192 .Bl -tag -width /etc/rc.shutdown -compact
193 .It Pa /etc/nologin
194 tells
195 .Xr login 1
196 not to let anyone log in
197 .It Pa /fastboot
198 tells
199 .Xr rc 8
200 not to run
201 .Xr fsck 8
202 when rebooting
203 .It Pa /etc/rc.shutdown
204 System shutdown commands
206 .Sh SEE ALSO
207 .Xr login 1 ,
208 .Xr wall 1 ,
209 .Xr fastboot 8 ,
210 .Xr halt 8 ,
211 .Xr init 8 ,
212 .Xr poweroff 8 ,
213 .Xr reboot 8 ,
214 .Xr rescue 8
215 .Sh BACKWARD COMPATIBILITY
216 The hours and minutes in the second time format may be separated by
217 a colon (``:'') for backward compatibility.
218 .Sh HISTORY
221 command appeared in
222 .Bx 4.0 .