working simple-minded (n^2 alg) tree version.
[unix-history] / usr / src / sbin / shutdown / shutdown.8
CommitLineData
7ead89cf
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
3c22338f 5.\" @(#)shutdown.8 6.5 (Berkeley) %G%
7ead89cf 6.\"
db21ad9e 7.TH SHUTDOWN 8 ""
7ead89cf
KM
8.UC 4
9.SH NAME
10shutdown \- close down the system at a given time
11.SH SYNOPSIS
12.B /etc/shutdown
13[
3c22338f 14.B \-fhkrn
7ead89cf
KM
15]
16time [ warning-message ... ]
17.SH DESCRIPTION
18.I Shutdown
19provides an automated shutdown procedure which a super-user
3c22338f
KB
20can use to notify users nicely when the system is shutting down,
21saving them from system administrators, hackers, and gurus, who
22would otherwise not bother with such niceties.
23.PP
7ead89cf 24.I Time
3c22338f
KB
25is the time at which \fIshutdown\fP will bring the system down and
26may be the word \fInow\fP (indicating an immediate shutdown) or
27specify a future time in one of two formats: \fI+number\fP, or
28\fIyymmddhhmm\fP, where the year, month, and day may be defaulted
29to the current system values. The first form brings the system down in
30\fInumber\fP minutes and the second at the absolute time specified.
7ead89cf 31.PP
3c22338f
KB
32Any other arguments comprise the warning message that is broadcast
33to users currently logged into the system; if no other arguments
34are provided, the warning message is read from the standard input.
7ead89cf 35.PP
3c22338f
KB
36At intervals, which get closer together as apocalypse approaches,
37starting at ten hours before shutdown, warning messages are displayed
38at the terminals of all users on the system. Five minutes before
39shutdown, or immediately if shutdown is in less than 5 minutes,
40logins are disabled by creating \fI/etc/nologin\fP and copying the
41warning message there. If this file exists when a user attempts to
42log in, \fIlogin\fP(1) prints its contents and exits. The file is
43removed just before \fIshutdown\fP exits.
44.PP
45At shutdown time a message is written in the system log, containing the
46time of shutdown, who ran shutdown and the reason. Then a terminate
47signal is sent to \fIinit\fP to bring the system down to single-user state.
7ead89cf 48Alternatively, if
cccdca83
KM
49.B \-r,
50.B \-h,
7ead89cf 51or
cccdca83 52.B \-k
3c22338f 53is used, then
7ead89cf
KM
54.I shutdown
55will exec
56.IR reboot (8),
57.IR halt (8),
58or avoid shutting the system down (respectively).
59(If it isn't obvious,
60.B \-k
61is to make people
62.I think
63the system is going down!)
64.PP
a5bc296a
JL
65With the
66.B \-f
67option,
68.I shutdown
69arranges, in the manner of
70.IR fastboot (8),
71that when the system is rebooted the file systems will not
72be checked. The
73.B \-n
74option prevents the normal
75.IR sync (2)
76before stopping.
77.PP
7ead89cf 78The time of the shutdown and the warning message
3c22338f 79are placed in \fI/etc/nologin\fP and should be used to
7ead89cf
KM
80inform the users about when the system will be back up
81and why it is going down (or anything else).
82.SH FILES
3c22338f
KB
83.TP 15
84/etc/nologin
85tells login not to let anyone log in
86.TP 15
87/fastboot
88tells /etc/rc not to run fsck when rebooting
7ead89cf 89.SH "SEE ALSO"
3c22338f
KB
90login(1), wall(1), fastboot(8), halt(8), reboot(8)
91.SH "BACKWARD COMPATIBILITY"
92The hours and minutes in the second time format may be separated by
93a colon (``:'') for backward compatibility.
94