Solaris Run Levels

November 12, 2009

The run levels in Solaris are little different than what you know about run levels in Linux. So, if you come from Linux background this could be little confusing initially.

There are total 8 run levels in Solaris. Default run level is 3. At a given point of time, a system can be in only one run level.

0    Power Down State
To shut down the operating system so that it is safe to turn off power to the system. This will bring the machine to Open Boot Prompt (OK)

s or S    Single User State
To run as a single user with some file systems mounted and accessible.

1     Administrative State
To access all available file systems. User logins are disabled.

2    Multiuser State
For normal operations. Multiple users can access the system and all file system. All daemons are running except for the NFS server daemons.

3    Multiuser level with NFS resources shared
For normal operations with NFS resources shared. This is the default run level for the Solaris environment.

4    Alternative multiuser state
Currently unavailable.

5    Power-down state
To shut down the operating system so that it is safe to turn off power to the system. If possible, automatically turns off power on systems that support this feature.

6    Reboot state
To shut down the system to run level 0, and then reboot to multiuser level with NFS resources shared (or whatever level is the default in the inittab file).


How to set the hostname in Solaris 10

May 23, 2009

If you have a system with a fresh installed Solaris 10 and it does not have an entry with ‘name server’, there are chances that it’ll set the hostname as ‘unknown’. To change this hostname you need to edit 3 files, follow the following steps:

For the sake of example, say the IP of my system is and I want to set the hostname to ‘sol10_sparc’

File 1

Use a text editor like vi to open and edit the following file:

# vi /etc/hosts

By default you’ll find the following line in the above file: unknown #set by DHCP

Simply edit the file to replace ‘unknown’ with your hostname to make it look like as: sol10_sparc #set by DHCP

File 2

Next we need to edit the file called nodename

# vi /etc/nodename

Just insert the hostname ‘sol10_sparc’ into this file.

File 3

And now last, find out the name of your ethernet card with the ‘ifconfig -a’ command. Say my ethernet card is called ‘rge0’. I’ll create and edit the following file:

# vi /etc/hostname.rge0

Insert your new hostname ‘sol10_sparc’ in this file, save and exit.

Restart your machine:

# init 6

That’s it, after your machine restarts, check the hostname:

# hostname

Done, enjoy 🙂