|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Administration: Common Tasks Oracle Solaris 11 Information Library|
Oracle Solaris is designed to run continuously so that the electronic mail and network software can work correctly. However, some system administration tasks and emergency situations require that the system be shut down to a level where it is safe to remove power. In some cases, the system needs to be brought to an intermediate level, where not all system services are available.
Such cases include the following:
Adding or removing hardware
Preparing for an expected power outage
Performing file system maintenance, such as a backup
For information about using your system's power management features, see the poweradm(1M) man page.
For detailed information when to shutdown a system and which commands to use, see System Shutdown Commands in Booting and Shutting Down Oracle Solaris on SPARC Platforms.
# shutdown -iinit-state -ggrace-period -y
Brings the system to an init state that is different from the default of S. The choices are 0, 1, 2, 5, and 6.
Run levels 0 and 5 are states reserved for shutting the system down. Run level 6 reboots the system. Run level 2 is available as a multiuser operating state.
Indicates a time (in seconds) before the system is shut down. The default is 60 seconds.
Continues to shut down the system without intervention. Otherwise, you are prompted to continue the shutdown process after 60 seconds.
For more information, see the shutdown(1M) man page.
Do you want to continue? (y or n): y
If you used the shutdown -y command, you will not be prompted to continue.
Type Ctrl-d to proceed with normal startup, (or give root password for system maintenance): xxxxxx
Example 4-3 SPARC: Bringing a System to a Shutdown State (Run Level 0) by Using the shutdown Command
In the following example, the shutdown command is used to bring a SPARC based system to run level 0 in five minutes without requiring additional confirmation.
# who root console Jun 17 12:39 userabc pts/4 Jun 17 12:39 (:0.0) # shutdown -i0 -g300 -y Shutdown started. Thu Jun 17 12:40:25... Broadcast Message from root (console) on pretend Thu Jun 17 12:40:25... The system pretend will be shut down in 5 minutes . . . Changing to init state 0 - please wait # INIT: New run level: 0 The system is coming down. Please wait. System services are now being stopped. . . . The system is down. syncing file systems... done Program terminated Type help for more information ok
Regardless of why you shut down a system, you will probably want to return to run level 3, where all file resources are available, and users can log in. For instructions on bringing a system back to a multiuser state, SPARC: How to Boot a System to a Multiuser State (Run Level 3).
Run levels 0, 5, and 6 are reserved for shutting down a system. Bringing a system to run level 0 enables power to the system to be safely turned off. As shown in the example that follows, the init command is used to bring a system to run level 0.
Use this procedure when you need to shut down a stand-alone system.
# init 5
For more information, see the init(1M) man page.
Example 4-4 Bringing a System to the Shutdown State (Run Level 0) by Using the init Command
In the following example, the init command is used to bring a system to the level where it is safe to turn off power:
# init 0 # INIT: New run level: 0 The system is coming down. Please wait. . . . The system is down. syncing file systems...    done Press any key to reboot