Solaris Run level change

Well finally, I have started to use Solaris. Whenever I get different version of UNIX; I need to find out runlevel related information, as you may need to change runlevel for following causes:

  1. Halt/reboot system when shutdown command don’t work
  2. Troubleshooting or repairing system

The first thing I noticed was /etc/inittab file is different from the Linux version. However, runlevel are quite identical

Default Solaris Run Level

  • S : Single user state (useful for recovery)
  • 0 : Access Sun Firmware ( ok> prompt)
  • 1 : System administrator mode
  • 2 : Multi-user w/o NFS
  • 3 : Multi-user with NFS
  • 4 : Unused
  • 5 : Completely shutdown the host (like performing a power-off @ OBP) [ thanks to Marco ]
  • 6 : Reboot but depend upon initdefault entry in /etc/inittab

Solaris Find out runlevel
To find out current runlevel use who command:

$ who -r

Output:

  .       run-level 3  Mar  3 14:04     3      0  S

Solaris changing runlevels after bootup
You need to use init command, for example change runlevel to 2.

# /sbin/init 2

Solaris changing the default runlevel
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.

Open /etc/inittab file:

# vi /etc/inittab

Find out this entry:

is:3:initdefault:

Change is:3 to number you want, don’t use S, 0, 6 ;). Save file.

See also

  • Read man page of inittab and init for more information.
  • There is also a nice program called runlevel for Solaris.

(Check out all of our posts on Solaris)


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 8 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
8 comments… add one
  • Anonymous Mar 3, 2006 @ 16:57

    The run level 5 completely shutdown the host (like performing a power-off @ OBP)
    I like your blog!
    Regards
    Marco

  • LinuxTitli Mar 3, 2006 @ 18:01

    I was just wondering about run level 5, under Linux it is for X window.

    Thanks Marco!

  • Anonymous Oct 11, 2006 @ 18:38

    Hi,

    I’d like to know about the previos run-level when doing “who -r”

    Why previous run=level is S
    Why not 2? since we’re currently on 3.

  • Nate Duehr May 1, 2007 @ 22:46

    Some SysV implementations jump straight from S to their final runlevel… others work their way up from the lower ones. Never assume anything in a lower runlevel is EVER started in any other… always create all the symlinks for everything you want running at each level.

  • priyaraj Jun 13, 2007 @ 4:02

    can i have my oown run levels?

  • Sriram Dec 14, 2007 @ 13:57

    Are runlevel S and 1 not same ???

  • Jai Arun Aug 9, 2011 @ 12:32

    Yes, Run levels S and 1 are not same… because 1 is a numeric number and S is alphabet.

  • Modiby Sep 23, 2011 @ 2:17

    Way to answer a 3 and a half year old question

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum