 |
Index for Section 8 |
|
 |
Alphabetical listing for S |
|
 |
Bottom of page |
|
shutdown(8)
NAME
shutdown - Shuts down a single system or an entire cluster
SYNOPSIS
/usr/sbin/shutdown [-bfhknrs] time [warning-message...]
/usr/sbin/shutdown -c [-h | -hs] time [warning-message...]
OPTIONS
-b Sends a shutdown message to the rwalld daemon on all remote client
hosts that have NFS file systems mounted from this system. This option
is incompatible with the -c option.
-c Shuts down and halts all members of a cluster in an orderly fashion.
The -h and -s options are invoked by default when the -c option is
specified alone. That is, there is no difference between specifying the
-c option alone and specifying -csh. If any options other than -h and
-s are specified with the -c option, the shutdown command displays a
usage message and exits.
-f Performs a fast shutdown (in the manner of the fastboot and the
fasthalt programs), bypassing the messages to other users and bringing
the system down as quickly as possible. The system halts or reboots
without checking the file systems. For example, the shutdown -f time
command brings the system to single user and creates the /fastboot
file; when the system reboots to multiuser, it does not invoke fsck.
The shutdown -f -r time command shuts the system down, creates the
/fastboot file, then immediately reboots. The shutdown -f -h time
command creates the /fastboot file and halts the system.
The -f option is incompatible with the -c and -n options.
-h Causes the system or cluster to shut down and halt.
When shutting down a single system, the shutdown command sends a
SIGTERM signal to the init process, which brings it to single-user
mode, and then issues a halt command. However, if the -s option is
specified with the -h option, the shutdown command executes the run-
level transition scripts (and does not send the SIGTERM signal) before
halting the system.
Because halt is the only option when shutting down an entire cluster,
the -h option is invoked by default when the -c option is specified
alone.
-k Sends shutdown messages to users, warning them of an impending
shutdown. However, the system does not actually shut down. The
/etc/nologin_hostname file is not created.
This option is incompatible with the -c option.
-n Bypasses the normal synchronization (syncing) of disks before stopping
the system.
The -n option is incompatible with the -f and -c options.
-r Causes the system to shut down and reboot.
The shutdown command accomplishes this by sending a SIGTERM signal to
the init process, which brings it to single-user mode, and then issues
the reboot command. However, if the -s option is specified with the -r
option, the shutdown command executes the run-level transition scripts
(and does not send the SIGTERM signal) before rebooting the system.
This option is incompatible with the -c option.
-s Executes the stop entry point of the run-level transition scripts in
/sbin/rc0.d/Knn_name, /sbin/rc2.d/Knn_name, and /sbin/rc3.d/Knn_name
(for example, the stop entry point of /sbin/rc0.d/K45syslog).
The run level at which the shutdown command is invoked determines which
scripts are executed. If the current run level is level 3 or higher,
the Knn_name scripts from all three directories are run. If the run
level is 2, then only scripts from /sbin/rc0.d and /sbin/rc2.d are run.
If the run level is 1, only scripts from /sbin/rc0.d are run.
This option is default for single-system shutdowns and optional for
clusterwide shutdowns. But it is invoked by default for clusterwide
shutdowns, if the -c option is specified alone. It can be used only
with the -r, -c, or -h options.
OPERANDS
time
Defines the time at which the shutdown command will shut down the
system (or cluster when the -c option is specified). There are several
ways to express this time:
· Use the word now to cause an immediate shutdown.
· Specify a future time using the format: +number. This format
starts a shutdown in number minutes.
· Specify a future time using the format: hhmm. This format starts a
shutdown at the indicated time. You can separate the hours (hh)
and minutes (mm) with a colon (:).
warning-message
Anything following the time operand on the command line is considered
to be a message, which is broadcast to users currently logged into the
system or cluster. Prior to shutdown, the message is displayed on all
user terminals. The message is sent more frequently as the shutdown
time approaches.
DESCRIPTION
The shutdown command provides an automated shutdown procedure. You must be
root to use this command.
When shutting down a single system, use the shutdown command shown in the
first format line in the SYNOPSIS section. If the -s option is not
specified, the shutdown command sends a SIGTERM signal to the init process,
which shuts the system down to single-user mode. It then halts the system,
reboots it, or does nothing, depending upon whether the -h, -r, or neither
option is specified:
· If the -h option is specified, the system is shut down to single-user
mode and then halted.
· If the -r option is specified, the system is shut down to single-user
mode and rebooted.
· If neither the -h or -r options is specified, the system is shut down
to and remains in single-user mode.
If you specify the -s option with the -h or -r option, the shutdown command
does not send the SIGTERM signal prior to halting or rebooting the system.
Rather, it executes the stop entry point of the run level transition
scripts in /sbin/rc0.d/Knn_name, /sbin/rc2.d/Knn_name, and
/sbin/rc3.d/Knn_name. The run level at which the shutdown command is
invoked determines which scripts are executed.
When shutting down an entire cluster, use the shutdown command shown in the
second format line in the SYNOPSIS section:
/usr/sbin/shutdown -c [-h | -hs] time [warning-message...]
You must shut an entire cluster down to a halt. Automatic reboots and
shutting down to single-user mode are not supported. (If you want to bring
a cluster member to single-user mode, first shut down that member to a halt
and then boot it to single-user mode.)
If you specify only the -c option, the -h and -s options are invoked by
default. If you specify both the -c and -h options, the cluster halts
without executing the stop entry point of the run-level transition scripts.
The shutdown process is similar for single-system and cluster shutdowns.
Five minutes before shutdown (or immediately, if shutdown is in fewer than
five minutes) the shutdown command creates the /etc/nologin_hostname file
(or /etc/nologin in the case of a clusterwide shutdown) and copies the
warning-message and time of the shutdown to it. If a user subsequently
attempts to log in, the login program checks for the existence of
/etc/nologin_hostname or /etc/nologin as appropriate, prints the contents,
and exits. The shutdown command removes the /etc/nologin_hostname or
/etc/nologin file just before it exits.
Similarly, when the shutdown command is invoked with the -c option to shut
down an entire cluster, the shutdown command creates the
/cluster/admin/.clu_shutdown_file file and copies the shutdown parameters
to it. The existence of this file prevents new members from joining a
cluster while a clusterwide shutdown is in progress. (This means that you
must never reboot a cluster member before all cluster members have been
shut down to a halt and are resting at the console boot prompt.) It also
prevents multiple clusterwide shutdowns from occurring simultaneously.
The time operand establishes a "grace period" during which you can cancel a
shutdown. You must not abort a shutdown process after the grace period
ends and the shutdown actually begins.
To cancel a system or cluster shutdown during the grace period, use the
following procedure:
1. From the system on which you executed the shutdown command, identify
the shutdown processes. There is a single shutdown process for
/usr/sbin/shutdown; in a cluster, there may also be a
/usr/sbin/clu_shutdown process. For example:
# ps ax | grep -v grep | grep shutdown
14680 ttyp5 I < 0:00.01 /usr/sbin/shutdown +20 going down
14687 ttyp5 I < 0:00.01 /usr/sbin/clu_shutdown
2. Terminate all of them by specifying their PIDs in a kill command. For
example:
# kill 14680 14687
If you kill the shutdown processes during the grace period, the shutdown is
canceled and the /etc/nologin_hostname file is removed. In a clusterwide
shutdown, the /etc/nologin and /cluster/admin/.clu_shutdown_file files are
removed.
Caution
If a clusterwide shutdown does not run to completion, the remaining
members could be left in a state with quorum checking turned off.
Logins, member boots, and additional clusterwide shutdowns could all
be disabled. To clear this state, you must manually shut down the
remaining members one at a time (for example, by using the shutdown
-h command) before resuming cluster operation. Failure to do so can
lead to unpredictable cluster operation and possible data corruption.
In the rare event that a member does not respond to the shutdown -h
command, use the /usr/sbin/halt command to halt it. If you must halt
multiple members in this manner, halt them one at a time. As a final
resort, press the member's halt button to halt it and then crash the
system at the console prompt to create a crash dump.
At shutdown time, the shutdown command writes a message to the system log.
This message states the time of the shutdown, who ran the shutdown command,
and the reason.
RESTRICTIONS
You can only use the -h and -s options with the -c option, but they are
invoked by default when you use the -c option alone. There is no difference
if you use the shutdown command with the -c option or with the -chs
options.
You cannot use the -f option with the -n option.
You can only use the -s option with the -c, -h, or -r options.
FILES
/usr/sbin/shutdown
Specifies the command path.
/etc/nologin
Location of the nologin file for a clusterwide shutdown.
/etc/nologin_hostname
Location of the nologin file for a nonclustered system. For example,
/etc/nologin_sys5.sys.site.com.
/cluster/admin/.clu_shutdown_file
Contains parameters associated with a clusterwide shutdown. This file
is locked during a clusterwide shutdown to prevent multiple
simultaneous clusterwide shutdowns and to keep new members from joining
the cluster during the shutdown.
/cluster/admin/.clu_shutdown_log
A record of all clusterwide shutdowns for the cluster is written to
this file.
/usr/sbin/clu_shutdown
Clusterwide shutdown script called by the shutdown command.
SEE ALSO
Commands: login(1), wall(1), fastboot(8), fasthalt(8), halt(8), reboot(8)
 |
Index for Section 8 |
|
 |
Alphabetical listing for S |
|
 |
Top of page |
|