summaryrefslogtreecommitdiffstats
path: root/login-utils/shutdown.8
blob: 961579bdcc9223f275305581be1e71a50a39e7c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
.\" May be distributed under the GNU General Public License
.\"
.\" 
.TH SHUTDOWN 8 "24 July 1998" "Linux 2.0" "Linux Programmer's Manual"
.SH NAME
shutdown \- close down the system
.SH SYNOPSIS
.nf
.BR "shutdown [ \-h | \-r ] [ \-fqs ] [ now | " hh:ss " | " +mins " ] [ " message " ]"
.BR "reboot [ \-h | \-r ] [ \-fqs ] [ now | " hh:ss " | " +mins " ] [ " message " ]"
.BR "fastboot [ \-h | \-r ] [ \-fqs ] [ now | " hh:ss " | " +mins " ] [ " message " ]"
.BR "halt [ \-h | \-r ] [ \-fqs ] [ now | " hh:ss " | " +mins " ] [ " message " ]"
.BR "fasthalt [ \-h | \-r ] [ \-fqs ] [ now | " hh:ss " | " +mins " ] [ " message " ]"
.fi
.SH DESCRIPTION
.\" " for emacs hilit19
In general,
.B shutdown
prepares the system for a power down or reboot.  A absolute or delta time
can be given, and periodic messages will be sent to all users warning of
the shutdown. If no message is specified on the command line,
.B shutdown
will ask for a message to be sent, unless the 
.B \-q
option is set.

.B halt
is the same as
.B "shutdown -h -q now"

.B fasthalt
is the same as
.B "shutdown -h -q -f now"

.B reboot
is the same as
.B "shutdown -r -q now"

.B fastboot
is the same as
.B "shutdown -r -q -f now"

The default delta time, if none is specified, is 2 minutes.

Five minutes before shutdown (or immediately, if shutdown is less than five
minutes away), the
.I /etc/nologin
file is created with a message stating that the system is going down and
that logins are no longer permitted.  The
.B login (1)
program will not allow non-superusers to login during this period.  A
message will be sent to all users at this time.

When the shutdown time arrives,
.B shutdown
notifies all users, tells
.BR init (8)
not to spawn more
.BR getty (8)'s,
writes the shutdown time into the
.I /var/log/wtmp
file, kills all other processes on the system,
.BR sync (2)'s,
unmounts all the disks,
.BR sync (2)'s
again, waits for a second, and then either terminates or reboots the
system.
.SH OPTIONS
.TP
.B \-h
Halt the system.  Do not reboot.  This option is used when powering down
the system.
.TP
.B \-r
Reboot the system.
.TP
.B \-f
Fast.  When the system is rebooted, the file systems will not be checked.
This is arranged by creating
.IR /fastboot ,
which
.I /etc/rc
must detect (and delete).
.TP
.B \-q
Quiet.  This uses a default broadcast message, and does not prompt the user
for one.
.TP
.B \-s
Reboot in single user mode.  This is arranged by creating
.IR /etc/singleboot ,
which
.BR simpleinit (8)
detects (and deletes).
.SH FILES
.nf
.I /etc/rc
.I /fastboot
.I /etc/singleboot
.I /etc/nologin
.I /var/log/wtmp
.I /etc/shutdown.conf
.fi
.SH CONFIG
The configuration file \fI/etc/shutdown.conf\fP is used to determine
the action to take when halting the machine. The currently supported
file format is extremely primitive. The first line must contain two
strings separated by whitespace. The first string must be
\fBHALT_ACTION\fP and the second specifies the action you wish to take
on halt. The options allowed are:
.TP
.B halt
This will simply halt the system. This is the default behaviour.
Note also that this is the fallback if another option fails.
.TP
.B power_off
This will use the kernel power shutdown facility. This is usually only
available on machines with Advanced Power Management (APM).
.TP
.I programname
This specifies a command to run to shut down the power. The first
character must be a "/". Bear in mind that this command will be run
with only the root filesystem mounted (and it will be read-only), and
no daemons running.
.SH "SEE ALSO"
.BR umount (8),
.BR login (1),
.BR reboot (2),
.BR simpleinit (8),
.BR init (8)
.SH BUGS
Unlike the BSD
.BR shutdown ,
users are notified of shutdown only once or twice, instead of many times,
and at shorter and shorter intervals as "apocalypse approaches."
Some would construe this as a feature.
.SH AUTHOR
This page documents the version of
.B shutdown
originally written by Peter Orbaek (poe@daimi.aau.dk).