.TH shutdown "" "" Command
.PC "Shut down the \*(CO system"
\fB/etc/shutdown [ reboot | halt | single | powerfail ] \fItime\fR
.PP
.II "single-user mode"
.B shutdown
shuts down the \*(CO system.
You must use this command to shut \*(CO down.
.I
Failure to shut down the system before rebooting or shutting off the computer
could damage the \*(CO file system and destroy data.
.R
.PP
When you invoke
.BR shutdown ,
you must specify the ``level'' shutdown, and the time to shutdown.
The level must be one of the following:
.IP \fBreboot\fR
Bring down the system, then reboot it automatically.
Use this level if, for example, you are installing a new kernel.
.IP \fBhalt\fR
Halt the system, but do not reboot it or enter single-user mode.
Use this option when you intend to turn off your computer.
.IP \fBsingle\fR
Bring down the system to single-user mode.
.IP \fBpowerfail\fR
Bring down the system as quickly as possible.
Normally, this level is invoked by a daemon that has received information
of a power failure from your system's uninterruptable power supply (UPS).
.\" Assuming you have one.
.PP
.I time
is the interval, in minutes, from the time you invoke the command to the
time that
.B shutdown
shuts the system down.
Setting
.I time
to zero shuts down the system immediately.
Every minute,
.B shutdown
displays on every user's terminal the message
.DM
	System going down in \fIN\fP minutes!
.DE
.PP
where
.I N
is the number of minutes left until shutdown.
When time has expired,
.B shutdown
displays the message
.DM
	System is going down now!
.DE
.PP
at which point users have ten seconds to save their files and exit.
Users who have turned off system messages will not, of course, see these
messages.
.PP
After the system has been halted, you do not need to type
.BR sync ;
.B shutdown
does that automatically.
.PP
If users have not logged off from the system when it comes time to shut
the system down, you will see the prompt:
.DM
	Some file systems remain mounted.  Proceed with shutdown ? [y]
.DE
.PP
If you type `n', the shutdown will be aborted.
You should then make sure that the users have logged off, then invoke
.B /etc/shutdown
again.
To lock out new users from logging in while you are trying to shut the
system down, create the file
.BR /etc/nologin .
Note that this file is removed automatically when you reboot your system.
.PP
If you type `y',
.B shutdown
will continue as before.
Users will be thrown off the system; any files they might have had opened
at that time will not be updated.
.SH "See Also"
.Xr "commands," commands
.Xr "nologin," nologin
.Xr "reboot" reboot
.SH Notes
Only the superuser \fBroot\fR can run
.BR shutdown .
.PP
.B shutdown
can be run from any terminal.
When the system reboots, however, control returns to the system console.
.PP
.II "Munk, Udo"
.B shutdown
was written by Udo Munk (udo@umunk.GUN.de).
