About nixCraft

Topics

Solaris Run level change

Posted by Vivek Gite [Last updated: March 3, 2006]

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

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

(Check out all of our posts on Solaris)

Tell us how we're doing: Please answer a few questions about your experience to help us improve nixCraft.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. Anonymous Says:

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

  2. LinuxTitli Says:

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

    Thanks Marco!

  3. Anonymous Says:

    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.

  4. Nate Duehr Says:

    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.

  5. priyaraj Says:

    can i have my oown run levels?

  6. Sriram Says:

    Are runlevel S and 1 not same ???

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.