shutdown(1M) — ADMINISTRATOR COMMANDS
NAME
shutdown − shut down system, change system state
SYNOPSIS
shutdown [ −y ] [ −ggrace_period [ −iinit_state ]
DESCRIPTION
This command is executed by the super-user to change the state of the machine. In most cases, it is used to change from the multi-user state (state 2) to another state (see below).
By default, it brings the system to a state where only the console has access to the UNIX system. This state is called single-user (see below).
The command sends a warning message and a final message before it starts actual shutdown activities. By default, the command asks for confirmation before it starts shutting down daemons and killing processes. The options are used as follows:
−y pre-answers the confirmation question so the command can be run without user intervention. A default of 60 seconds is allowed between the warning message and the final message. Another 60 seconds is allowed between the final message and the confirmation.
−ggrace_period
allows the super-user to change the number of seconds from the 60-second default.
−iinit_state specifies the state that init is to be put
in following the warnings, if any. By default, system state “s” is used.
Other recommended system state definitions are:
state 0 Shut the machine down so it is safe to remove the power. Have the machine remove power if it can. The rc0 procedure is called to do this work.
state 1 State 1 is referred to as the administrative state. In state 1 filesystems required for multi-user operations are mounted, and logins requiring access to multi-user filesystems can be used. When the system comes up from firmware mode into state 1, only the console is active and other multi-user (state 2) services are unavailable. Note that not all user processes are stopped when transitioning from multi-user state to state 1.
state s, S
State s (or S) is referred to as the single-user state. All user processes are stopped on transitions to this state. In the single-user state, filesystems required for multi-user logins are unmounted, except that the /var and /usr filesystems are not explicitly unmounted upon transition to this state. Logins requiring access to multi-user file systems cannot be used and the system can only be accessed through the console.
state 5 Stop the UNIX system and go to firmware mode.
state 6 Stop the UNIX system and reboot to the state defined by the initdefault entry in /etc/inittab; configure a new bootable operating system, if necessary, before the reboot. The rc6 procedure is called to do this work.
NOTES
shutdown(1M) behaves differently depending on the number of users logged in. If several users are logged in, three messages are displayed, warning, final and confirmation, with grace period between each message. If only the user issuing shutdown(1M) is logged in, two messages are displayed, the final and confirmation message, with grace period between them.
If the system is being shutdown to state 0 or state 6, you may see warning messages like the one below.
WARNING: dis_vfs: dounmount() [error # = 16]; filesystem [major = 116,
minor = 256] not unmounted
One of these messages will be output for each file system that could not be unmounted because a process held some resource(s) found in that file system at the time of the shutdown. Each file system that fails to be unmounted at shutdown time will have to be checked before it can be used, typically via the fsck(1M) program. If these messages occur, notify your system administrator so the errant process(es) can be fixed.
SEE ALSO
init(1M), rc0(1M), rc2(1M), rc6(1M), inittab(4), fsck(1M)
— Essential Utilities