Go to main content

Booting and Shutting Down Oracle® Solaris 11.4 Systems

Exit Print View

Updated: November 2020
 
 

How Run Levels Work

A system's run level (also known as an init state) defines what services and resources are available to users. A system can be on only one run level at a time.

Oracle Solaris has eight run levels, which are described in the following table. The default run level is specified in the /etc/inittab file as run level 3.

Table 1  Oracle Solaris Run Levels
Run Level
Init State
Purpose
0
Power-down state
To shut down the operating system so that it is safe to turn off power to the system.
s or S
Single-user state
To run as a single user with some file systems mounted and accessible.
1
Administrative state
To access all available file systems. User logins are disabled.
2
Multiuser state
For normal operations. Multiple users can access the system and all file systems. All daemons are running except for the NFS server daemons.
3
Multiuser level with NFS resources shared
For normal operations with NFS resources shared. This is the default run level.
4
Alternative multiuser state
Not configured by default, but available for customer use.
5
Power-down state
To shut down the operating system so that it is safe to turn off power to the system. If possible, automatically turns off power on systems that support this feature.
6
Reboot state
To stop the operating system and reboot to the state that is defined by the initdefault entry in the /etc/inittab file.
The SMF service, svc:/system/boot-config:default, is enabled by default. When the config/fastreboot_default property is set to true, init 6 bypasses certain firmware initialization and test steps, depending on the specific capabilities of the system. See Accelerating the Reboot Process.

In addition, the svcadm command can be used to change the run level of a system, by selecting a milestone at which to run. The following table shows which run level corresponds to each milestone.

Table 2  Run Levels and SMF Milestones
Run Level
SMF Milestone FMRI
S
milestone/single-user:default
2
milestone/multiuser:default
3
milestone/multiuser-server:default

When to Use Run Levels or Milestones

In general, changing milestones or run levels is an uncommon procedure. If it is necessary, using the init command to change to a run level will change the milestone as well and is the appropriate command to use. The init command is also good for shutting down a system.

However, booting a system using the none milestone can be very useful for debugging startup problems. There is no equivalent run level to the none milestone. For more information, see How to Investigate Problems Starting Services at System Boot in Managing System Services in Oracle Solaris 11.4.

When a system is being booted you can select the milestone to boot to or select the level of error messages to be recorded.

  • SPARC based systems

    To specify a milestone to boot, use the following command:

    ok boot -m milestone=milestone

    The default milestone is all which starts all enabled services. To start only the init, svc.startd and svc.configd services, specify none. The none milestone enables you to start services manually and is useful for debugging. See How to Investigate Problems Starting Services at System Boot in Managing System Services in Oracle Solaris 11.4 for instructions on how to use the none milestone.

    The run-level equivalents single-user, multiuser, and multiuser-server are also available, but are not commonly used. The multiuser-server milestone, in particular does not start any services which are not a dependency of that milestone, so may not include important services.

    To specify the level of logging, use the following command:

    ok boot -m logging-level

    Specify quiet, verbose or debug. For information about logging levels, see Specifying the Amount of Startup Messaging in Managing System Services in Oracle Solaris 11.4.

  • x86 based systems

    To specify a milestone to boot or to choose the level of logging, edit the GRUB menu at boot time. Add the –m smf-options kernel argument to the end of the $multiboot line of the specified boot entry. For example:

    $multiboot /ROOT/s11.3_18/@/$kern $kern -B $zfs_bootfs -m logging-level

Determining a System's Current Run Level

To determine a system's current run level, use the who -r command. Output similar to the following example is displayed:

$ who -r
      run-level 3  Dec 13 10:10  3  0 S

The two rightmost information bits in the output indicate the number of times the system has been at this run level since the last reboot (0) and the system's previous run level (S).