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