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. As such, 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, sometimes these actions are needed in emergency situations. For instructions
on system recovery techniques, see Chapter 12, Booting an Oracle Solaris System (Tasks) andChapter 13, Managing the Oracle Solaris Boot Archives (Tasks).
Note – On x86 systems that are running at least the Solaris 10 6/06 release,
pressing and releasing the power button initiates a clean system shutdown.
This method is equivalent to using the init 5 command.
The following table describes the various shutdown commands and
provides recommendations for using them.
Table 10–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 operating at run level 3 because users are notified
of the impending shutdown. 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 synchronizes the disks before changing run levels.
|
Recommended for stand-alone 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 synchronizes the disks and passes boot instructions
to the uadmin system call. In turn, this system call stops
the processor.
|
The init command is the preferred method.
|
halt, poweroff
|
An executable that synchronizes the disks and stops the processor.
|
Not recommended because it doesn't shutdown all processes, and unmount
any remaining file systems. Stopping the services, without doing a clean shutdown,
should only be done in an emergency or if most of the services are already
stopped.
|