version 1 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
SHUTDOWN |
|
|
2 |
!!!SHUTDOWN |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
ACCESS CONTROL |
|
|
8 |
FILES |
|
|
9 |
NOTES |
|
|
10 |
AUTHOR |
|
|
11 |
SEE ALSO |
|
|
12 |
---- |
|
|
13 |
!!NAME |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
shutdown - bring the system down |
|
|
17 |
!!SYNOPSIS |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
__/sbin/shutdown__ [[__-t__ ''sec''] |
|
|
21 |
[[__-arkhncfF__] ''time'' |
|
|
22 |
[[''warning-message''] |
|
|
23 |
!!DESCRIPTION |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
__shutdown__ brings the system down in a secure way. All |
|
|
27 |
logged-in users are notified that the system is going down, |
|
|
28 |
and login(1) is blocked. It is possible to shut the |
|
|
29 |
system down immediately or after a specified delay. All |
|
|
30 |
processes are first notified that the system is going down |
|
|
31 |
by the signal SIGTERM . This gives programs |
|
|
32 |
like vi(1) the time to save the file being edited, |
|
|
33 |
mail and news processing programs a chance to exit cleanly, |
|
|
34 |
etc. __shutdown__ does its job by signalling the |
|
|
35 |
__init__ process, asking it to change the runlevel. |
|
|
36 |
Runlevel __0__ is used to halt the system, runlevel |
|
|
37 |
__6__ is used to reboot the system, and runlevel __1__ |
|
|
38 |
is used to put to system into a state where administrative |
|
|
39 |
tasks can be performed; this is the default if neither the |
|
|
40 |
''-h'' or ''-r'' flag is given to __shutdown__. To |
|
|
41 |
see which actions are taken on halt or reboot see the |
|
|
42 |
appropriate entries for these runlevels in the file |
|
|
43 |
''/etc/inittab''. |
|
|
44 |
!!OPTIONS |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
__-a__ |
|
|
48 |
|
|
|
49 |
|
|
|
50 |
Use __/etc/shutdown.allow__. |
|
|
51 |
|
|
|
52 |
|
|
|
53 |
__-t__ ''sec'' |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
Tell init(8) to wait ''sec'' seconds between |
|
|
57 |
sending processes the warning and the kill signal, before |
|
|
58 |
changing to another runlevel. |
|
|
59 |
|
|
|
60 |
|
|
|
61 |
__-k__ |
|
|
62 |
|
|
|
63 |
|
|
|
64 |
Don't really shutdown; only send the warning messages to |
|
|
65 |
everybody. |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
__-r__ |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
Reboot after shutdown. |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
__-h__ |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
Halt after shutdown. |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
__-n__ |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
[[DEPRECATED] Don't call init(8) to do the shutdown |
|
|
84 |
but do it ourself. The use of this option is discouraged, |
|
|
85 |
and its results are not always what you'd |
|
|
86 |
expect. |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
__-f__ |
|
|
90 |
|
|
|
91 |
|
|
|
92 |
Skip fsck on reboot. |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
__-F__ |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
Force fsck on reboot. |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
__-c__ |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
Cancel an already running shutdown. With this option it is |
|
|
105 |
of course not possible to give the __time__ argument, but |
|
|
106 |
you can enter a explanatory message on the command line that |
|
|
107 |
will be sent to all users. |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
''time'' |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
When to shutdown. |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
''warning-message'' |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
Message to send to all users. |
|
|
120 |
|
|
|
121 |
|
|
|
122 |
The ''time'' argument can have different formats. First, |
|
|
123 |
it can be an absolute time in the format ''hh:mm'', in |
|
|
124 |
which ''hh'' is the hour (1 or 2 digits) and ''mm'' is |
|
|
125 |
the minute of the hour (in two digits). Second, it can be in |
|
|
126 |
the format __+__''m'', in which ''m'' is the number |
|
|
127 |
of minutes to wait. The word __now__ is an alias for |
|
|
128 |
__+0__. |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
If shutdown is called with a delay, it creates the advisory |
|
|
132 |
file ''/etc/nologin'' which causes programs such as |
|
|
133 |
''login(1)'' to not allow new user logins. Shutdown |
|
|
134 |
removes this file if it is stopped before it can signal init |
|
|
135 |
(i.e. it is cancelled or something goes wrong). It also |
|
|
136 |
removes it before calling init to change the |
|
|
137 |
runlevel. |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
The __-f__ flag means `reboot fast'. This only creates an |
|
|
141 |
advisory file ''/fastboot'' which can be tested by the |
|
|
142 |
system when it comes up again. The boot rc file can test if |
|
|
143 |
this file is present, and decide not to run fsck(1) |
|
|
144 |
since the system has been shut down in the proper way. After |
|
|
145 |
that, the boot process should remove |
|
|
146 |
''/fastboot''. |
|
|
147 |
|
|
|
148 |
|
|
|
149 |
The __-F__ flag means `force fsck'. This only creates an |
|
|
150 |
advisory file ''/forcefsck'' which can be tested by the |
|
|
151 |
system when it comes up again. The boot rc file can test if |
|
|
152 |
this file is present, and decide to run fsck(1) with |
|
|
153 |
a special `force' flag so that even properly unmounted |
|
|
154 |
filesystems get checked. After that, the boot process should |
|
|
155 |
remove ''/forcefsck''. |
|
|
156 |
|
|
|
157 |
|
|
|
158 |
The __-n__ flag causes __shutdown__ not to call |
|
|
159 |
__init__, but to kill all running processes itself. |
|
|
160 |
__shutdown__ will then turn off quota, accounting, and |
|
|
161 |
swapping and unmount all filesystems. |
|
|
162 |
!!ACCESS CONTROL |
|
|
163 |
|
|
|
164 |
|
|
|
165 |
__shutdown__ can be called from init(8) when the |
|
|
166 |
magic keys __CTRL-ALT-DEL__ are pressed, by creating an |
|
|
167 |
appropriate entry in ''/etc/inittab''. This means that |
|
|
168 |
everyone who has physical access to the console keyboard can |
|
|
169 |
shut the system down. To prevent this, __shutdown__ can |
|
|
170 |
check to see if an authorized user is logged in on one of |
|
|
171 |
the virtual consoles. If __shutdown__ is called with the |
|
|
172 |
__-a__ argument (add this to the invocation of shutdown |
|
|
173 |
in /etc/inittab), it checks to see if the file |
|
|
174 |
''/etc/shutdown.allow'' is present. It then compares the |
|
|
175 |
login names in that file with the list of people that are |
|
|
176 |
logged in on a virtual console (from ''/var/run/utmp''). |
|
|
177 |
Only if one of those authorized users __or root__ is |
|
|
178 |
logged in, it will proceed. Otherwise it will write the |
|
|
179 |
message |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
__shutdown: no authorized users logged in |
|
|
183 |
__to the (physical) system console. The format of ''/etc/shutdown.allow'' is one user name per line. Empty lines and comment lines (prefixed by a __#__) are allowed. Currently there is a limit of 32 users in this file. |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
Note that if ''/etc/shutdown.allow'' is not present, the |
|
|
187 |
__-a__ argument is ignored. |
|
|
188 |
!!FILES |
|
|
189 |
|
|
|
190 |
|
|
|
191 |
/fastboot |
|
|
192 |
/etc/inittab |
|
|
193 |
/etc/init.d/halt |
|
|
194 |
/etc/init.d/reboot |
|
|
195 |
/etc/shutdown.allow |
|
|
196 |
!!NOTES |
|
|
197 |
|
|
|
198 |
|
|
|
199 |
A lot of users forget to give the ''time'' argument and |
|
|
200 |
are then puzzled by the error message __shutdown__ |
|
|
201 |
produces. The ''time'' argument is mandatory; in 90 |
|
|
202 |
percent of all cases this argument will be the word |
|
|
203 |
__now__. |
|
|
204 |
|
|
|
205 |
|
|
|
206 |
Init can only capture CTRL-ALT-DEL and start shutdown in |
|
|
207 |
console mode. If the system is running the X window System, |
|
|
208 |
the X server processes all key strokes. Some X11 |
|
|
209 |
environments make it possible to capture CTRL-ALT-DEL, but |
|
|
210 |
what exactly is done with that event depends on that |
|
|
211 |
environment. |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
Shutdown wasn't designed to be run setuid. |
|
|
215 |
/etc/shutdown.allow is not used to find out who is executing |
|
|
216 |
shutdown, it ONLY checks who is currently logged in on (one |
|
|
217 |
of the) console(s). |
|
|
218 |
!!AUTHOR |
|
|
219 |
|
|
|
220 |
|
|
|
221 |
Miquel van Smoorenburg, miquels@cistron.nl |
|
|
222 |
!!SEE ALSO |
|
|
223 |
|
|
|
224 |
|
|
|
225 |
fsck(8), init(8), halt(8), |
|
|
226 |
poweroff(8), reboot(8) |
|
|
227 |
---- |