.\"{{{}}} .\"{{{ Title .TH SHUTDOWN 8 "May 31, 1996" "" "Linux System Administrator's Manual" .\"}}} .\"{{{ Name .SH NAME shutdown \- bring the system down .\"}}} .\"{{{ Synopsis .SH SYNOPSIS .B /sbin/shutdown .RB [ \-t .IR sec ] .RB [ \-rkhncf ] .I time .RI [ warning-message ] .\"}}} .\"{{{ Description .SH DESCRIPTION .B Shutdown brings the system down in a secure way. All logged in users are notified that the system is going down, and \fIlogin(1)\fP is blocked. It is possible to shut the system down immideately, or after a delay. All processes are first notified that the system is going down by the signal \s-2SIGTERM\s0. This gives programs like \fIvi(1)\fP the time to save the file being editted, mail and news processing programs a chance to exit cleanly, etc. \fBShutdown\fP does it's job by signalling the \fBinit\fP process, asking it to change the \fIrunlevel\fP. \fIRunlevel 0\fP is used to halt the system, \fIrunlevel 6\fP is used to reboot the system and \fIrunlevel 1\fP is used to put to system into a state where administrative tasks can be performed; this is the default if neither the \fI-h\fP or \fI-r\fP flag is given to \fBshutdown\fP. To see which actions are taken on halt or reboot see the appropriate entries of these \fIrunlevels\fP in the file \fI/etc/inittab\fP. .\"}}} .\"{{{ Options .SH OPTIONS .\"{{{ -t sec .IP "\fB\-t\fP \fIsec\fP" Tell init to wait \fIsec\fP seconds between sending processes the warning and the kill signal, before changing to another \fIrunlevel\fP. .\"}}} .\"{{{ -k .IP \fB\-k\fP Don't really shutdown; only send the warning messages to everybody. .\"}}} .\"{{{ -r .IP \fB\-r\fP Reboot after shutdown. .\"}}} .\"{{{ -h .IP \fB\-h\fP Halt after shutdown. .\"}}} .\"{{{ -n .IP \fB\-n\fP [DEPRECIATED] Don't call init to do the shutdown but do it ourself. The use of this option is discouraged, and its results are not always what you'd expect. .\"}}} .\"{{{ -f .IP \fB\-f\fP Do a `fast' reboot. .\"}}} .\"{{{ -c .IP \fB\-c\fP Cancel an already running shutdown. With this option it is ofcourse not possible to give the \fBtime\fP argument, but you can enter a explanitory message on the command line that will be sent to all users. .\"}}} .\"{{{ time .IP \fItime\fP When to shutdown. .\"}}} .\"{{{ warning-message .IP \fIwarning-message\fP Message to send to all users. .\"}}} .PP The \fItime\fP argument can have different formats. First, it can be an absolute time in the format \fIhh:mm\fP, in which \fIhh\fP is the hour (1 or 2 digits) and \fImm\fP is the minute of the hour (in two digits). Second, it can be in the format \fB+\fP\fIm\fP, in which \fIm\fP is the number of minutes to wait. The word \fBnow\fP is an alias for \fB+0\fP. .PP The \fB\-f\fP flag means `reboot fast'. This only creates an advisory file \fB/fastboot\fP which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide not to run \fIfsck(1)\fP since the system has been shut down in the proper way. After that, the boot process should remove \fB/fastboot\fP. .PP The \fB-n\fP flag causes shutdown not to call init, but to kill all running processes itself. After all processes are killed, \fBshutdown\fP will try to run the script \fI/etc/rc.d/rc.halt fast\fP (or rc.reboot). It also tests for the presence of the equivalent files \fIrc.0\fP and \fIrc.6\fP. If this script returns or can't be executed (because it's not present for example) \fBshutdown\fP will turn off \fIquota\fP and \fIaccounting\fP, turn off \fIswapping\fP and \fIunmount\fP all filesystems. .\"}}} .\"{{{ Files .SH Access Control \fBShutdown\fP can be called from \fBinit\fP(8) when the magic keys \fBCTRL-ALT-DEL\fP are pressed, by creating an appropriate entry in \fI/etc/inittab\fP. This means that everyone who has physical access to the console keyboard can shut the system down. To prevent this, \fBshutdown\fP can check to see if an authorized user is logged in on one of the virtual consoles. If \fBshutdown\fP is called from \fBinit\fP, it checks to see if the file \fI/etc/shutdown.allow\fP is present. It then compares the login names in that file with the list of people that are logged in on a virtual console (from \fI/var/run/utmp\fP). Only if one of those authorized users \fBor root\fP is logged in, it will proceed. Otherwise it will write the message .sp 1 .nf \fBshutdown: no authorized users logged in\fP .fi .sp 1 to the (physical) system console. The format of \fI/etc/shutdown.allow\fP is one user name per line. Empty lines and comment lines (prefixed by a \fB#\fP) are allowed. Currently there is a limit of 32 users in this file. .SH FILES .nf /fastboot /etc/inittab /etc/rc.d/rc.halt /etc/rc.d/rc.reboot /etc/shutdown.allow .fi .\"}}} .SH BUGS Not really a bug, but most users forget to give the \fItime\fP argument and are then puzzled by the error message \fBshutdown\fP produces. The \fItime\fP argument is mandatory; in 90 percent of all cases this argument will be the word \fBnow\fP. .\"{{{ Author .SH AUTHOR Miquel van Smoorenburg, miquels@cistron.nl .\"}}} .\"{{{ See also .SH "SEE ALSO" fsck(8), init(1), halt(8), reboot(8) .\"}}}