]> git.saurik.com Git - apple/system_cmds.git/blame - shutdown.tproj/shutdown.8
system_cmds-671.10.3.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
34d340d7 42.Nm shutdown
20e66415
A
43.Op Fl
44.Oo
b180c247
A
45.Fl h
46.Op Fl u
47|
34d340d7 48.Fl r | Fl s | Fl k
20e66415
A
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 57The
34d340d7 58.Nm shutdown
20e66415 59utility provides an automated shutdown procedure for super-users
1815bff5
A
60to nicely notify users when the system is shutting down,
61saving them from system administrators, hackers, and gurus, who
62would otherwise not bother with such niceties.
63.Pp
20e66415
A
64The following options are available:
65.Bl -tag -width indent
1815bff5
A
66.It Fl h
67The system is halted at the specified
20e66415 68.Ar time .
1815bff5
A
69.It Fl k
70Kick everybody off.
71The
72.Fl k
73option
74does not actually halt the system, but leaves the
75system multi-user with logins disabled (for all but super-user).
20e66415
A
76.It Fl n
77If the
78.Fl o
79is specified, prevent the file system cache from being flushed by passing
80.Fl n
81option to
82.Xr halt 8
83or
84.Xr reboot 8 .
85This option should probably not be used.
34d340d7
A
86.It Fl o
87If
88.Fl h
89or
90.Fl r
91is specified,
92.Nm shutdown
93will execute
94.Xr halt 8
95or
96.Xr reboot 8
97instead of sending a signal to
98.Xr launchd 8 .
99.It Fl r
100The system is rebooted at the specified
101.Ar time .
102.It Fl s
103The system is put to sleep at the specified
104.Ar time .
b180c247
A
105.It Fl u
106The system is halted up until the point of removing system power, but waits
107before removing power for 5 minutes so that an external UPS
108(uninterruptible power supply) can forcibly remove power.
109This simulates a dirty shutdown to permit a later automatic power on. OS X uses
110this mode automatically with supported UPSs in emergency shutdowns.
1815bff5
A
111.It Ar time
112.Ar Time
113is the time at which
34d340d7 114.Nm shutdown
1815bff5
A
115will bring the system down and
116may be the word
117.Ar now
118(indicating an immediate shutdown) or
119specify a future time in one of two formats:
120.Ar +number ,
121or
122.Ar yymmddhhmm ,
123where the year, month, and day may be defaulted
124to the current system values. The first form brings the system down in
125.Ar number
126minutes and the second at the absolute time specified.
127.It Ar warning-message
128Any other arguments comprise the warning message that is broadcast
129to users currently logged into the system.
130.It Fl
131If
20e66415 132.Sq Fl
1815bff5
A
133is supplied as an option, the warning message is read from the standard
134input.
135.El
136.Pp
137At intervals, becoming more frequent as apocalypse approaches
138and starting at ten hours before shutdown, warning messages are displayed
34d340d7 139on the terminals of all users logged in.
1815bff5 140.Pp
20e66415
A
141At shutdown time a message is written to the system log, containing the
142time of shutdown, the person who initiated the shutdown and the reason.
143Corresponding signal is then sent to
34d340d7 144.Xr launchd 8
20e66415
A
145to respectively halt, reboot or bring the system down to single-user state
146(depending on the above options).
20e66415
A
147.Pp
148A scheduled shutdown can be canceled by killing the
34d340d7 149.Nm shutdown
20e66415
A
150process (a
151.Dv SIGTERM
152should suffice).
34d340d7
A
153.Sh SIGTERM TO SIGKILL INTERVAL
154Upon shutdown, all running processes are sent a SIGTERM followed by a SIGKILL.
20e66415 155The
34d340d7
A
156.Dv SIGKILL
157will follow the
158.Dv SIGTERM
159by an intentionally indeterminate period of time.
160Programs are expected to take only enough time to flush all dirty data and exit.
161Developers are encouraged to file a bug with the OS vendor, should they encounter an issue with this functionality.
1815bff5 162.Sh SEE ALSO
20e66415 163.Xr kill 1 ,
1815bff5
A
164.Xr login 1 ,
165.Xr wall 1 ,
1815bff5 166.Xr halt 8 ,
34d340d7 167.Xr launchd 8 ,
1815bff5
A
168.Xr reboot 8
169.Sh BACKWARD COMPATIBILITY
170The hours and minutes in the second time format may be separated by
171a colon (``:'') for backward compatibility.
172.Sh HISTORY
173The
34d340d7 174.Nm shutdown
20e66415 175utility appeared in
1815bff5 176.Bx 4.0 .