System Shutdown Commands
The use of the init and shutdown
commands are the primary ways to shut down a system. Both commands perform
a clean shutdown of the system,
which means that all file system changes are written to the disk, and all
system services, processes, and the operating system are terminated normally.
The use of a system's stop key sequence or turning a system off and
then on are not clean shutdowns because system services are terminated abruptly.
However, it is sometimes necessary to use these actions in emergency situations.
For instructions on system recovery techniques, see Chapter 13, SPARC: Booting a System (Tasks)
or Chapter 14, IA: Booting a System (Tasks).
The following table describes the various shutdown commands and provides
recommendations for using them.
Table 12–1 Shutdown Commands
Command
|
Description
|
When To Use
|
shutdown
|
An executable shell script that calls
the init program to shut down the system. The system is
brought to run level S by default.
|
Recommended for servers running at
run level 3 because users are notified of the impending shut down. Also notified
are the systems that are mounting resources from the server that is being
shut down.
|
init
|
An executable that kills all active
processes and syncs the disks before changing run levels.
|
Recommended
for standalone systems when other users will not be affected. Provides a faster
system shutdown because users are not notified of the impending shutdown.
|
reboot
|
An executable that syncs the disks
and passes boot instructions to the uadmin system call,
which, in turn, stops the processor.
|
Not recommended. Use the init command
instead.
|
halt
|
An executable that syncs the disks
and stops the processor.
|
Not recommended because it doesn't execute the /etc/rc0 script. This script stops all processes, syncs the disks,
and unmounts any remaining file systems.
|