The primary function of shutdown is to terminate all currently
running processes in an orderly and cautious manner.
shutdown goes through the following steps:
All users logged on the system are notified to log off the system
by a broadcast message.
/etc/init is called to perform the actual shutdown.
Only root can run the shutdown command directly.
A user possessing the shutdown subsystem authorization can
shut down the system using the asroot command:
/tcb/bin/asroot shutdown
shutdown takes the following options:
-ffile
file is the pathname of a file containing a message
to be sent to all terminals warning of the imminent shutdown
during the grace period.
-f``mesg''
mesg is a message enclosed in a pair of double quotes ("")
to be sent to all terminals warning of the imminent shutdown
during the grace period.
-g[hh:]mm
Specifies the number of hours and minutes before shutdown
(maximum: 72 hours). 1 minute is the default.
(To shut down the system immediately without a grace period, use
/etc/haltsys or /etc/reboot.
Note that these commands should not be used if NFS,
TCP/IP or certain other services are running.)
-i[0156abcsS]
Specifies the init level to bring the system to (see
init(M)).
By default, the system is brought to level 0.
-y
Runs the command silently.
If this option is not specified, shutdown will prompt for
confirmation to shut down the system.
The optional su argument lets the system go single-user without
completely shutting it down.
(This option is identical to -i1
and is present for backwards compatibility with XENIX).
Broadcast messages, whether default or defined, are displayed at regular
intervals during the grace period.
The closer the shutdown time, the more frequent the message.
Time left until shutdown
Frequency of message
Greater than 1 hour
Every hour
Greater than 15 minutes
Every 15 minutes
Less than 15 minutes
Every minute
In general, if no options are specified, shutdown behaves as
follows:
prompt for confirmation
60-second grace period
bring the system to init level 0
broadcast default message prior to shutdown
Diagnostics
The most common error diagnostic that will occur is ``device busy''.
This diagnostic appears when a particular filesystem could not
be unmounted.
See
mount(ADM).
Warning
Once shutdown has been invoked, it must be allowed to run
to completion and must not be interrupted by pressing
<Break> or <Del>.
shutdown does not work when executed from within a shell layer.