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