This chapter provides guidelines for shutting down and booting a system. The Solaris software environment is designed to run continuously so that electronic mail and network resources are available to users. Occasionally, it is necessary to shut down or reboot a system because of a system configuration change, a scheduled maintenance event, or a power outage.
This is a list of overview information in this chapter.
This section describes new features related to shutting down and booting a system in the Solaris 7 release.
Bug ID 1154696 has been fixed in the Solaris 7 release. This means that you can cleanly bring your system down to run level S (or single-user mode) by using the shutdown -s or the init -s command. The inittab file and the rc scripts in the /etc/init.d directory and the /etc/rcn.d directories have been modified to ensure system run level transitions are made cleanly and efficiently.
See "Troubleshooting 64-bit Solaris Boot Problems" for information on booting a system running the 32-bit or 64-bit Solaris 7 operating environment.
Use these references to find step-by-step instructions for shutting down and booting a system.
This section describes the terminology used in shutting down and booting a system.
Run levels and init states - A run level is a letter or digit representing a system state in which a particular set of system services are available. The system is always running in one of a set of well-defined run levels. Run levels are also referred to as init states because the init process is used to perform transitions between run levels. System administrators use the init(1M) command to initiate a run-level transition. This book refers to init states as run levels.
Boot Types - A boot type describes how a system is booted. Different boot types include:
Interactive boot - You are prompted to provide information about how the system is booted, such as the kernel and device path name.
Reconfiguration boot - The system is reconfigured to support newly added hardware or new pseudo devices.
Recovery boot - The system is hung or an invalid entry is prohibiting the system from booting successfully or from allowing users to log in.
Keep the following in mind when shutting down a system:
Use the init and shutdown commands to shut down a system. Both commands perform a clean system shutdown, which means all system processes and services are terminated normally.
Use the shutdown command to shut down a server, because logged-in users and systems mounting resources from the server are notified before the server is shut down. Additional notification of system shutdowns via electronic mail is also recommended so that users can be prepared for system downtime.
You need superuser privileges to use the shutdown or init command to shut down a system.
Both shutdown and init commands take a run level as an argument. The three most common run levels are:
Run level 3 - Means that all system resources are available and users can log in. By default, booting a system brings it to run level 3, which is used for normal day-to-day operations. Also known as multiuser level with NFS resources shared.
Run level 6 - Stops the operating system and reboots to the state defined by the initdefault entry in the /etc/inittab file.
Run level 0 - Means the operating system is shut down and it is safe to turn off power. Bringing a system to run level 0 is needed whenever the system is moved or hardware is added or removed.
Run levels are fully described in Chapter 6, Run Levels and Boot Files (Tasks).
Keep the following in mind when booting a system:
After a system is shut down, it is booted by using the boot command at the PROM level on a SPARC system or by using the boot command at the Primary Boot Subsystem Menu on an Intel system.
A system can be rebooted by turning the power off and then back on. This is not a clean shutdown because system services and processes are terminated abrubtly. However, turning a system's power off and back is an alternative for emergency situations.
SPARC and x86 systems use different hardware components for booting. These differences are described in Chapter 10, The Boot Process (Reference).
Perform a reconfiguration boot when adding new hardware to the system or configuring support for pseudo devices, such as increasing the number of pseudo devices (ptys). Table 5-1 to determine which reconfiguration procedure to use.
Table 5-1 Reconfiguration Procedures
If You Are Reconfiguring the System To ... |
See ... |
---|---|
Add a secondary disk |
Chapter 23, SPARC: Adding a Disk (Tasks) or Chapter 24, x86: Adding a Disk (Tasks) |
Add some other peripheral device | |
Change the number of pseudo devices |
"Examining and Changing System Information (Tasks)" in System Administration Guide, Volume II |
Table 5-2 provides a list of system administration tasks and the type of shut down needed to initiate the task.
Table 5-2 Shutting Down a System
If You Are ... |
Change to This Run Level ... |
See ... |
---|---|---|
Turning off system power due to anticipated power outage |
Run level 0, where it is safe to turn off power | |
Changing kernel parameters in the /etc/system file |
Run level 6 (reboot the system) | |
Performing file system maintenance, such as backing up or restoring system data |
Run level S (single-user mode) | |
Repairing a system configuration file such as /etc/system |
N/A |
|
Changing pseudo device parameters in the /etc/system file |
Reconfiguration boot |
"Tuning Kernel Parameters (Tasks)" in System Administration Guide, Volume II |
Adding or removing hardware from the system |
Reconfiguration boot (plus turning off power when adding or removing hardware) | |
Repairing an important system file which is causing system boot failure |
N/A |
|
Booting the kernel debugger (kadb) to track down a system problem |
Run level 0, if possible | |
Recovering from a hung system and you want to force a crash dump |
N/A |
See Chapter 7, Shutting Down a System (Tasks) for examples of shutting down a server or standalone system.
Table 5-3 provides a list of system administration tasks and the corresponding boot type used to complete the task.
Table 5-3 Booting a System
If You Are Rebooting the System After ... |
Use This Boot Type ... |
See SPARC Procedure ... |
See x86 Procedure ... |
---|---|---|---|
Turning off system power due to anticipated power outage |
Turn system power back on | ||
Changing kernel parameters in the /etc/system file |
Reboot the system to run level 3 (multiuser mode with NFS resources shared) |
"SPARC: How to Boot a System to Run Level 3 (Multiuser State)" |
"x86: How to Boot a System to Run Level 3 (Multiuser State)" |
Performing file system maintenance, such as performing a backup or restoring system data |
Use Control-d from run level S to bring the system back to run level 3 |
"SPARC: How to Boot a System to Run Level S (Single-User State)" |
"x86: How to Boot a System to Run Level S (Single-User State)" |
Repairing a system configuration file such as /etc/system |
Interactive boot | ||
Changing pseudo device parameters in the /etc/system file |
Reconfiguration boot |
"Tuning Kernel Parameters (Tasks)" in System Administration Guide, Volume II |
"Tuning Kernel Parameters (Tasks)" in System Administration Guide, Volume II |
Adding or removing hardware from the system |
Reconfiguration boot (plus turning on system power after adding or removing hardware) | ||
Booting the kernel debugger (kadb) to track down a system problem |
Booting kabd |
"SPARC: How to Boot the System Using the Kernel Debugger (kadb)" | |
Repairing an important system file which is causing system boot failure |
Recovery boot | ||
Recovering from a hung system and you want to force a crash dump |
Recovery boot |
See example on "x86: How to Force a Crash Dump and Reboot the System" |
See example on "x86: How to Force a Crash Dump and Reboot the System" |
See Chapter 8, Booting a SPARC System (Tasks) or Chapter 9, x86: Booting a System (Tasks) for examples of booting a system.