shutdown(1M)


shutdown -- shut down system, change system state

Synopsis

shutdown [-y] [-ggrace_period] [-iinit_state]

Description

This command is executed by a privileged 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 state ``0'': the state in which it is safe to remove the power. This state is called the shutdown state.

The command sends a warning message and a final message before it starts actual shutdown activities. shutdown gets the default value for a grace_period following each of these messages from /etc/default/shutdown, if that file exists. The value of grace_period is implementation dependent. If shutdown cannot find the file or cannot read the value, it displays a warning and sets the grace period to 60 seconds. 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 grace_period is allowed between the warning message and the final message. Another grace_period is allowed between the final message and the confirmation.

-ggrace_period
allows a privileged user to change the grace_period from the default.

-iinit_state
specifies the state that init is to be put in following the warnings, if any. By default, system state ``0'' is used.

Other recommended system state definitions are:


state 0:
Shut the machine down so it is safe to remove the power. If possible, have the machine remove the power. (The rc0 procedure is invoked for this.)

state 1:
State 1 is referred to as the administrative state. File systems required for multi-user operations are mounted and logins requiring access to multi-user file systems can be used. When the system comes up from firmware mode into state 1, only the console is active; multi-user (state 2) services are unavailable. When the system is going from state 2 to state 1, some services are stopped and some processes are killed; otherwise, the system continues operating as it did in state 2. (The rc1 procedure is invoked for this.)

state s, S:
State s (or S) is referred to as the single-user state. All user processes are stopped and file systems required for multi-user logins are unmounted on transitions to this state. Thereafter, the system can be accessed only through the console; logins requiring access to multi-user file systems cannot be used. Run your system in this state to install or remove software utilities, or to back up, restore, or check a file system. The system enters state ``s'' automatically when the /var file system is corrupted and cannot be recovered. The set of file systems mounted while a system is in state ``s'' is not always the same; which file systems are mounted depends on the method by which the system entered state ``s'' and local computer site rules.

state 5:
Stop the operating system and go to firmware mode if the processor (system) supports it. If firmware mode is supported: (a) run special firmware commands and programs that reside in NVRAM--such as making a floppy key, and (b) run programs that reside in the /stand file system under the control of the NVRAM--such as running /stand/unix to reboot the system.

If there is no firmware mode, shut the system down so it is safe to remove power. If possible, have the machine remove the power. (The rc0 procedure is invoked for this.) See ``state 0.''


state 6:
Stop and reboot the operating system to the state defined by the initdefault entry in /etc/inittab. If necessary, configure a new bootable operating system before the reboot. (Because rc6 is linked to rc0 for backward compatibility, the rc0 procedure is invoked for this.)

Files

/etc/default/shutdown

References

init(1M), inittab(4), rc0(1M), rc2(1M)

Notices

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 is logged in, or if grace_period is 0, then no messages will be issued.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004