SHUTDOWN(8) — UNIX Programmer’s Manual
NAME
shutdown − close down the system at a given time
SYNOPSIS
/etc/shutdown [−k] [−r] [−h] [−f] [−n] time [warning-message ...]
DESCRIPTION
The shutdown command provides an automated shutdown procedure for the super-user to notify users when the system is shutting down. The time argument specifies when shutdown will bring the system down; it may be the word now (indicating an immediate shutdown), or it may specify a future time in one of two formats: +number and hour:minute. The first form brings the system down in number minutes, and the second brings the system down at the time of day indicated in 24-hour notation.
At intervals that get smaller as the system shutdown approaches, warning messages are displayed at terminals of all logged-in users, and of users who have remote mounts on that machine. Five minutes before shutdown, or immediately if shutdown is in less than 5 minutes, logins are disabled by creating the file /etc/nologin and writing a message there. If this file exists when a user attempts to log in, login prints its contents and exits. The file is removed just before shutdown exits.
At shutdown time a message is written in the system log, containing the time of shutdown, who ran shutdown and the reason. The script /etc/rc.shutdown is called with the argument warn. A terminal stop signal is sent to init, so that processes are not respawned as they die. If −r, −n, or −k, was used, then shutdown will exec reboot(8), halt(8), or avoid shutting the system down (respectively). Otherwise shutdown sends all remaining non-system processes a sigterm signal, then calls /etc/rc.shutdown with the argument shutdown. Finally, it sends a terminate signal to init, which brings the system down to single-user mode.
The option −k is to make people think the system is going down, but does not actually take it down.
With the −f option, shutdown arranges, in the manner of fastboot(8), that when the system is rebooted the file systems will not be checked.
The −n option prevents the normal sync(2) before stopping.
The time of the shutdown and the warning message are placed in the file /etc/nologin, which should be used to tell the users when the system will be back up, and why it is going down.
FILES
/etc/nologin tells login not to let anyone log in
/etc/rmtab list of remote hosts that have mounted this host
/etc/rc.shutdown system shutdown script
SEE ALSO
login(1), reboot(8), rc(8), init(8), halt(8), fastboot(8)
BUGS
Shutdown only allows you to kill the system between now and 23:59 if you use the absolute time for shutdown.
The disks will still be synced even if -n option is given if the rc.shutdown script runs commands that sync the disks (such as umount(8)).
4BSD