31 July 2010

Run level - Solaris

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) 
• 6 : Reboot but depend upon initdefault entry in /etc/inittab

Solaris 8/9 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.



* Only init states 0, 1, 5, 6, and S can be reached using shutdown.

Make changes to .bash_profile and need to update the current session?

$ source .bash_profile


With the above command, the user does not have to logout.

How to skip a service while starting in HP-UX

During the HP-UX OS booting,if you want the service/daemon need to be skipped  press crtl + backslash.

Most of us tried pressing ctrl + c, that wont work during the booting