sdhci - Implement ADMA2 transfer support. Keep SDMA support for now.
[dragonfly.git] / sbin / shutdown / shutdown.8
blob6816c0caa6f7a817af3e13348bd5d34f1d119869
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. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)shutdown.8  8.2 (Berkeley) 4/27/95
29 .\" $FreeBSD: src/sbin/shutdown/shutdown.8,v 1.12.2.5 2003/02/23 21:17:43 trhodes Exp $
30 .\"
31 .Dd September 29, 2016
32 .Dt SHUTDOWN 8
33 .Os
34 .Sh NAME
35 .Nm shutdown ,
36 .Nm poweroff
37 .Nd "close down the system at a given time"
38 .Sh SYNOPSIS
39 .Nm
40 .Op Fl
41 .Oo
42 .Fl h | Fl p |
43 .Fl r | Fl k
44 .Oc
45 .Oo
46 .Fl o
47 .Op Fl n
48 .Oc
49 .Ar time
50 .Op Ar warning-message ...
51 .Nm poweroff
52 .Sh DESCRIPTION
53 The
54 .Nm
55 utility provides an automated shutdown procedure for super-users
56 to nicely notify users when the system is shutting down,
57 saving them from system administrators, hackers, and gurus, who
58 would otherwise not bother with such niceties.
59 .Pp
60 The following options are available:
61 .Bl -tag -width indent
62 .It Fl h
63 The system is halted at the specified
64 .Ar time .
65 .It Fl p
66 The system is halted and the power is turned off
67 (hardware support required)
68 at the specified
69 .Ar time .
70 .It Fl r
71 The system is rebooted at the specified
72 .Ar time .
73 .It Fl k
74 Kick everybody off.
75 The
76 .Fl k
77 option
78 does not actually halt the system, but leaves the
79 system multi-user with logins disabled (for all but super-user).
80 .It Fl o
81 If one of the
82 .Fl h ,
83 .Fl p
85 .Fl r
86 is specified,
87 .Nm
88 will execute
89 .Xr halt 8
91 .Xr reboot 8
92 instead of sending signal to
93 .Xr init 8 .
94 .It Fl n
95 If the
96 .Fl o
97 is specified, prevent the file system cache from being flushed by passing
98 .Fl n
99 option to
100 .Xr halt 8
102 .Xr reboot 8 .
103 This option should probably not be used.
104 .It Ar time
105 .Ar Time
106 is the time at which
108 will bring the system down and
109 may be the word
110 .Ar now
111 (indicating an immediate shutdown) or
112 specify a future time in one of two formats:
113 .Ar +number ,
115 .Ar yymmddhhmm ,
116 where the year, month, and day may be defaulted
117 to the current system values.  The first form brings the system down in
118 .Ar number
119 minutes and the second at the absolute time specified.
120 .It Ar warning-message
121 Any other arguments comprise the warning message that is broadcast
122 to users currently logged into the system.
123 .It Fl
125 .Sq Fl
126 is supplied as an option, the warning message is read from the standard
127 input.
130 At intervals, becoming more frequent as apocalypse approaches
131 and starting at ten hours before shutdown, warning messages are displayed
132 on the terminals of all users logged in.  Five minutes before
133 shutdown, or immediately if shutdown is in less than 5 minutes,
134 logins are disabled by creating
135 .Pa /var/run/nologin
136 and copying the
137 warning message there.  If this file exists when a user attempts to
138 log in,
139 .Xr login 1
140 prints its contents and exits.  The file is
141 removed just before
143 exits.
145 At shutdown time a message is written to the system log, containing the
146 time of shutdown, the person who initiated the shutdown and the reason.
147 Corresponding signal is then sent to
148 .Xr init 8
149 to respectively halt, reboot or bring the system down to single-user state
150 (depending on the above options).
151 The time of the shutdown and the warning message
152 are placed in
153 .Pa /var/run/nologin
154 and should be used to
155 inform the users about when the system will be back up
156 and why it is going down (or anything else).
158 A scheduled shutdown can be canceled by killing the
160 process (a
161 .Dv SIGTERM
162 should suffice).
164 .Pa /var/run/nologin
165 file that
167 created will be removed automatically.
169 Calling
170 .Dq Nm poweroff
171 is equivalent to running:
172 .Bd -literal -offset indent
173 shutdown -p now
175 .Sh FILES
176 .Bl -tag -width /var/run/nologin -compact
177 .It Pa /var/run/nologin
178 tells login not to let anyone log in
180 .Sh BACKWARD COMPATIBILITY
181 The hours and minutes in the second time format may be separated by
182 a colon (``:'') for backward compatibility.
183 .Sh SEE ALSO
184 .Xr kill 1 ,
185 .Xr login 1 ,
186 .Xr wall 1 ,
187 .Xr nologin 5 ,
188 .Xr halt 8 ,
189 .Xr init 8 ,
190 .Xr reboot 8
191 .Sh HISTORY
194 command was originally written by Ian Johnstone for UNSW's modified
195 .At v6 .
196 It was modified and then incorporated in
197 .Bx 4.1 .