Upload Tizen:Base source
[framework/base/util-linux-ng.git] / login-utils / shutdown.8
1 .\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
2 .\" May be distributed under the GNU General Public License
3 .\"
4 .\"
5 .TH SHUTDOWN 8 "2 March 2000" "Linux 2.0" "Linux Programmer's Manual"
6 .SH NAME
7 shutdown \- close down the system
8 .SH SYNOPSIS
9 .B shutdown
10 .RB [ \-h | \-r ]
11 .RB [ \-fqs ]
12 .RB [ now | \fIhh\fP:\fIss\fP | +\fImins\fP ]
13 .RI [ message ]
14 .br
15 .B reboot
16 .RB [ \-h | \-r ]
17 .RB [ \-fqs ]
18 .RB [ now | \fIhh\fP:\fIss\fP | +\fImins\fP ]
19 .RI [ message ]
20 .br
21 .B fastboot
22 .RB [ \-h | \-r ]
23 .RB [ \-fqs ]
24 .RB [ now | \fIhh\fP:\fIss\fP | +\fImins\fP ]
25 .RI [ message ]
26 .br
27 .B halt
28 .RB [ \-h | \-r ]
29 .RB [ \-fqs ]
30 .RB [ now | \fIhh\fP:\fIss\fP | +\fImins\fP ]
31 .RI [ message ]
32 .br
33 .B fasthalt
34 .RB [ \-h | \-r ]
35 .RB [ \-fqs ]
36 .RB [ now | \fIhh\fP:\fIss\fP | +\fImins\fP ]
37 .RI [ message ]
38 .SH DESCRIPTION
39 .\" " for emacs hilit19
40 In general,
41 .B shutdown
42 prepares the system for a power down or reboot.  A absolute or delta time
43 can be given, and periodic messages will be sent to all users warning of
44 the shutdown. If no message is specified on the command line,
45 .B shutdown
46 will ask for a message to be sent, unless the
47 .B \-q
48 option is set.
49
50 .B halt
51 is the same as
52 .B "shutdown -h -q now"
53
54 .B fasthalt
55 is the same as
56 .B "shutdown -h -q -f now"
57
58 .B reboot
59 is the same as
60 .B "shutdown -r -q now"
61
62 .B fastboot
63 is the same as
64 .B "shutdown -r -q -f now"
65
66 The default delta time, if none is specified, is 2 minutes.
67
68 Five minutes before shutdown (or immediately, if shutdown is less than five
69 minutes away), the
70 .I /etc/nologin
71 file is created with a message stating that the system is going down and
72 that logins are no longer permitted.  The
73 .BR login (1)
74 program will not allow non-superusers to login during this period.  A
75 message will be sent to all users at this time.
76
77 When the shutdown time arrives,
78 .B shutdown
79 notifies all users, tells
80 .BR init (8)
81 not to spawn more
82 .BR getty (8)'s,
83 writes the shutdown time into the
84 .I /var/log/wtmp
85 file, kills all other processes on the system,
86 .BR sync (2)'s,
87 unmounts all the disks,
88 .BR sync (2)'s
89 again, waits for a second, and then either terminates or reboots the
90 system.
91
92 Prior to unmounting all discs, the \fBSIGQUIT\fP signal is sent to the
93 \fBinit\fP process, which will in turn exec \fBshutdown\fP(8). This
94 allows for clean unmounting, even if the old inode for the \fBinit\fP
95 process was unlinked. If the current process ID (PID) equals 1, then
96 \fBshutdown\fP(8) will pause forever.
97 .SH OPTIONS
98 .TP
99 .B \-h
100 Halt the system.  Do not reboot.  This option is used when powering down
101 the system.
102 .TP
103 .B \-r
104 Reboot the system.
105 .TP
106 .B \-f
107 Fast.  When the system is rebooted, the file systems will not be checked.
108 This is arranged by creating
109 .IR /fastboot ,
110 which
111 .I /etc/rc
112 must detect (and delete).
113 .TP
114 .B \-q
115 Quiet.  This uses a default broadcast message, and does not prompt the user
116 for one.
117 .TP
118 .B \-s
119 Reboot in single user mode.  This is arranged by creating
120 .IR /etc/singleboot ,
121 which
122 .BR simpleinit (8)
123 detects (and deletes).
124 .SH FILES
125 .nf
126 .I /etc/rc
127 .I /fastboot
128 .I /etc/singleboot
129 .I /etc/nologin
130 .I /var/log/wtmp
131 .I /etc/shutdown.conf
132 .fi
133 .SH CONFIG
134 The configuration file \fI/etc/shutdown.conf\fP is used to determine
135 the action to take when halting the machine. The currently supported
136 file format is extremely primitive. The first line must contain two
137 strings separated by whitespace. The first string must be
138 \fBHALT_ACTION\fP and the second specifies the action you wish to take
139 on halt. The options allowed are:
140 .TP
141 .B halt
142 This will simply halt the system. This is the default behaviour.
143 Note also that this is the fallback if another option fails.
144 .TP
145 .B power_off
146 This will use the kernel power shutdown facility. This is usually only
147 available on machines with Advanced Power Management (APM).
148 .TP
149 .I programname
150 This specifies a command to run to shut down the power. The first
151 character must be a "/". Bear in mind that this command will be run
152 with only the root filesystem mounted (and it will be read-only), and
153 no daemons running.
154 .SH "SEE ALSO"
155 .BR umount (8),
156 .BR login (1),
157 .BR reboot (2),
158 .BR simpleinit (8),
159 .BR init (8)
160 .SH BUGS
161 Unlike the BSD
162 .BR shutdown ,
163 users are notified of shutdown only once or twice, instead of many times,
164 and at shorter and shorter intervals as "apocalypse approaches."
165 Some would construe this as a feature.
166 .SH AUTHOR
167 This page documents the version of
168 .B shutdown
169 originally written by Peter Orbaek (poe@daimi.aau.dk).