System Administration Guide, Volume 1

How to Shut Down a System

Using 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 all file system changes are written to the disk, and all system services, processes, and the operating system are terminated normally.

Using 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, is it sometimes necessary to use these actions in emergency situations. See Chapter 10, SPARC: Booting a System (Tasks) or Chapter 11, IA: Booting a System (Tasks) for instructions on system recovery techniques.

The following table describes the various shutdown commands and provides recommendations for using them.

Table 9-1 Shutdown Commands

Command 

Description 

This Command Is ... 

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 as are the systems that are mounting resources from the server being shut down.  

init

An executable that kills all active process and syncs the disks before changing run levels.

Recommended for standalone systems when other users will not be affected. It provides a faster system shutdown because users are not notified of the impending shutdown. 

reboot

An executable that syncs the disks and passes booting 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, which stops all processes, syncs the disks, and unmounts any remaining file systems.


Note -

The /usr/sbin/shutdown command, not the /usr/ucb/shutdown command, is used in this chapter and throughout this book.