Solaris · Lesson

Solaris · Run Levels

Run Levels in Solaris

Run levels control the overall state of a Solaris system: from halt (0) to single-user (S) to full multi-user with networking (3) and reboot (6). Modern Solaris uses SMF milestones internally, but run levels are still important for administration, troubleshooting and interviews.

Add the YouTube embed URL for this lesson in components/solaris/solarisLessons.js.

What are run levels in Solaris?

Traditional UNIX and Solaris use run levels to define system state. Each run level represents a specific combination of started/stopped services and available functionality (single-user, multi-user, networking, etc.).

System state control

Each run level defines what services and users are allowed – from maintenance mode to full production.

Transition points

Changing run level transitions the system between states (e.g. 3 → S for maintenance).

Mapped to SMF

On Solaris 10/11, run levels are implemented internally using SMF milestones.

Visual overview of Solaris run levels

Replace the image URL below with your Cloudinary link to show a diagram of run levels (0, S, 1, 2, 3, 4, 5, 6) and transitions.

My Oracle Support - search SRU

Summary of Solaris run levels (0, s/S, 1, 2, 3, 4, 5, 6)

Run Level

0

Halt

OS is down; system stopped. Safe to power off.

Run Level

s / S

Single-user / Maintenance

Minimal environment, root only, for maintenance.

Run Level

1

Single-user (legacy)

Historically similar to S; rarely used on modern Solaris.

Run Level

2

Multi-user (no network)

Multiple users, basic services, usually minimal or no network.

Run Level

3

Multi-user with networking

Normal server mode: multi-user + network services (default).

Run Level

4

Unused / Custom

Site-specific usage if configured; often unused.

Run Level

5

Power down

Shut down and power off (ACPI-supported systems).

Run Level

6

Reboot

Graceful reboot; system restarts.

Most commonly used in practice

  • S / s → Single-user/maintenance mode.
  • 3 → Normal multi-user with networking (default server mode).
  • 0, 5, 6 → Shutdown/halt, power off, reboot.

Detailed differences – 0, s/S, 1, 2, 3, 4, 5, 6

Single-user related (s / S / 1)

  • s and S are effectively the same: single-user (maintenance) mode.
  • Only root is allowed to log in (usually on console).
  • Network services often stopped; minimal daemons running.
  • Used for disk checks, password recovery, repairs.
  • Run level 1 is a legacy name similar to S; rarely used on modern systems.

Multi-user related (2 / 3 / 4)

  • 2 → Multi-user without full networking (site-dependent).
  • 3 → Full multi-user with networking (default production level).
  • 4 → Generally unused; available for custom configurations if needed.

Shutdown & reboot (0 / 5 / 6)

  • 0 → Halt OS; system can be powered off.
  • 5 → Power off (ACPI-controlled systems) – effectively halt + power down.
  • 6 → Reboot – system will shutdown and immediately restart.

Run level commands & examples

In modern Solaris, you usually use shutdown to move between run levels cleanly, and who -r to check current run level. init calls are still supported and commonly used in scripts.

1. Check current run level with who -r

Shows current run level and previous run level with time since change.

terminal — run levels
solaris-lab
[root@solaris ~]# who -r
. run-level 3 Jan 20 10:15 3 0 S

2. Reboot system via shutdown

-i selects target run level, -g is grace period (seconds), -y auto-confirm.

terminal — run levels
solaris-lab
[root@solaris ~]# shutdown -i6 -g0 -y
Shutdown initiated.
The system will be brought to run level 6 now.

3. Switch to multi-user level 3 via init

init directly changes run level; usually use shutdown for planned changes.

terminal — run levels
solaris-lab
[root@solaris ~]# /sbin/init 3

4. Move to single-user mode (maintenance)

Single-user mode is for maintenance; only root is allowed and many services are offline.

terminal — run levels
solaris-lab
[root@solaris ~]# /sbin/init S
 
INIT: New run level: S
(system enters single-user mode; console login as root required)

5. Graceful OS shutdown to run level 0 (halt)

System halts, can be powered off safely.

terminal — run levels
solaris-lab
[root@solaris ~]# shutdown -i0 -g60 -y
# Waits 60 seconds then halts the system.

Run levels vs SMF milestones in Solaris 10/11

Under the hood, Solaris 10/11 use SMF (Service Management Facility) and milestones to control system state. Run levels are mapped to SMF milestones like:

Examples

  • Run level 3 → milestone multi-user-server
  • Run level S → milestone single-user

You can inspect SMF milestones and services with:

terminal — smf
solaris-lab
# Check services for multi-user-server milestone
[root@solaris ~]# svcs -p multi-user-server

Safety tips when changing run levels

  • For production systems, always use shutdown -iX -gN -y instead of direct init X (it gives users/applications time to exit).
  • Inform application teams before moving to S/0/5/6; they might need to stop services cleanly.
  • Do not experiment with run levels on critical servers during business hours.
  • Combine run level changes with proper pre-post-check steps you defined in the previous lesson.

Once you understand run levels clearly, boot troubleshooting and maintenance activities become much easier.