shutdown

Name

shutdown -- shut the system down

Synopsis

/sbin/shutdown [-t sec] [-h | -r] [-akfF] time [warning-message]
/sbin/shutdown -c [warning-message]

Description

The shutdown command shall shut the system down in a secure way (first synopsis), or cancel a pending shutdown (second synopsis). When the shutdown is initiated, all logged-in users shall be notified immediately that the system is going down, and users shall be prevented from logging in to the system. The time specifies when the actual shutdown shall commence. See below for details. At the specified time all processes are first notified that the system is going down by the signal SIGTERM. After an interval (see -t) all processes shall be sent the signal SIGKILL. If neither the -h or the -r argument is specified, then the default behavior shall be to take the system to a runlevel where administrative tasks can be run. See also Run Levels.

Note: This is sometimes referred to as "single user mode".

The -h and -r options are mutually exclusive. If either the -h or -r options are specified, the system shall be halted or rebooted respectively.

Standard Options

-a 

use access control. See below.

-t sec 

tell the system to wait sec seconds between sending processes the warning and the kill signal, before changing to another runlevel. The default period is unspecified.

-k 

do not really shutdown; only send the warning messages to everybody.

-r 

reboot after shutdown.

-h 

halt after shutdown. Actions after halting are unspecified (e.g. power off).

-f 

advise the system to skip file system consistency checks on reboot.

-F 

advise the system to force file system consistency checks on reboot.

-c 

cancel an already running shutdown.

time 

specify when to shut down.

The time argument shall have the following format: [now | [+]mins | hh:mm] If the format is hh:mm, hh shall specify the hour (1 or 2 digits) and mm is the minute of the hour (exactly two digits), and the shutdown shall commence at the next occurence of the specified time. If the format is mins (or +mins), where mins is a decimal number, shutdown shall commence in the specified number of minutes. The word now is an alias for +0.

warning-message 

specify a message to send to all users.

Access Control

If the shutdown utility is invoked with the -a option, it shall check that an authorized user is currently logged in on the system console. Authorized users are listed, one per line, in the file /etc/shutdown.allow. Lines in this file that begin with a '#' or are blank shall be ignored.

Note: The intent of this scheme is to allow a keyboard sequence entered on the system console (e.g. CTRL-ALT-DEL, or STOP-A) to automatically invoke shutdown -a, and can be used to prevent unauthorized users from shutting the system down in this fashion.