Solaris run levels (updated)
A system's run level (also known as an init state) defines what services and resources are available to users. At any one time, the system can be in only be in one init state at a time.
The following table lists the current 8 run levels available on a Solaris system.
|Run level||Init state||Purpose|
|0||PROM mode||To shut down the operating system so that it is safe to turn off power to the system.|
|s or S||Single-user mode||To run as a single user with some file systems mounted and accessible.|
|1||Management mode||A form of single-user mode, in which file systems are available but user logins disabled|
|2||Multi-user||All services available and users can login, but no NFS SMB services available|
|3||Multi-user||Multi-user mode with all services available (this is the default run level)|
|4||Alternate Multi-user||Wlist this state is unused, it is available to customer configuration/use.|
|5||Power-off||To shut down the operating system so that it is safe to turn off power to the system.
|6||Restart||Reboot the system into run level 3 (or whatever level is the default in the
Changing default run level
An entry with initdefault (in
/etc/inittab file) is scanned only when
init is initially invoked.
init uses this entry to determine which run level to enter initially.
To find the default run level, review
/etc/inittab and find the
initdefault entry. For example:
# grep initdefault /etc/inittab is:3:initdefault:
From the above entry, we see that the defailt run level set is 3.
We can use our favourite text editor to change this entry to match the default run level you desire.
Which run level am I at?
To check current run level in Solaris type the below command.
# who -r . run-level 3 May 9 08:12 3 0 S
- run-level 3 — Identifies the current run level
- May 9 08:12 — Identifies the date of last run level change
- 3 — Also identifies the current run level
- 0 — Identifies the number of times the system has been at this run level since the last reboot
- S — Identifies the previous run level
From Solaris 10 onwards it is no longer necessary to edit
inittab directly; administrators should use the Solaris Service Management Facility (SMF) to define services instead.
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.
|Run level||SMF milestone|