use getopt; translate newlines to spaces; minor lint cleanups
[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.\"
3060f563 5.\" @(#)shutdown.8 6.4 (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[
14.B \-k
15] [
16.B \-r
17] [
18.B \-h
a5bc296a
JL
19] [
20.B \-f
21] [
22.B \-n
7ead89cf
KM
23]
24time [ warning-message ... ]
25.SH DESCRIPTION
26.I Shutdown
27provides an automated shutdown procedure which a super-user
28can use to notify users
29nicely when the system is shutting down, saving them from
30system administrators, hackers, and gurus, who would otherwise
31not bother with niceties.
32.LP
33.I Time
34is the time at which
35.I shutdown
36will bring the system down and
cccdca83
KM
37may be the word
38.B now
39(indicating an immediate shutdown)
40or specify a future time in one of two formats:
7ead89cf
KM
41.BR + number
42and
43.RB hour : min.
44The first form brings the system down in
45.I number
46minutes
47and the second brings the system down at the time of day indicated
48(as a 24\-hour clock).
49.PP
50At intervals which get closer together as apocalypse approaches,
51warning messages are displayed at the terminals of all users on the
52system. Five minutes before shutdown, or immediately if
53shutdown is in less than 5 minutes, logins are disabled by
54creating
55/etc/nologin
56and writing a message there.
cccdca83 57If this file exists when a user attempts to log in,
7ead89cf
KM
58.IR login (1)
59prints its contents
60and exits.
61The file is removed just before
62.I shutdown
63exits.
64.PP
65At shutdown time a
8c0a4ae7 66message is written in the system log, containing the
7ead89cf 67time of shutdown, who ran shutdown and the reason.
3060f563 68Then a terminate signal is sent to
7ead89cf
KM
69.I init
70to bring the system down to single-user state.
71Alternatively, if
cccdca83
KM
72.B \-r,
73.B \-h,
7ead89cf 74or
cccdca83 75.B \-k
7ead89cf
KM
76was used, then
77.I shutdown
78will exec
79.IR reboot (8),
80.IR halt (8),
81or avoid shutting the system down (respectively).
82(If it isn't obvious,
83.B \-k
84is to make people
85.I think
86the system is going down!)
87.PP
a5bc296a
JL
88With the
89.B \-f
90option,
91.I shutdown
92arranges, in the manner of
93.IR fastboot (8),
94that when the system is rebooted the file systems will not
95be checked. The
96.B \-n
97option prevents the normal
98.IR sync (2)
99before stopping.
100.PP
7ead89cf
KM
101The time of the shutdown and the warning message
102are placed in /etc/nologin and should be used to
103inform the users about when the system will be back up
104and why it is going down (or anything else).
105.SH FILES
106.DT
107/etc/nologin tells login not to let anyone log in
7ead89cf 108.SH "SEE ALSO"
a5bc296a 109login(1), reboot(8), fastboot(8)
7ead89cf
KM
110.SH BUGS
111Only allows you to kill the system between now and 23:59 if
112you use the absolute time for shutdown.