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