Wednesday 5 February 2014

The Runlevels in Linux



Definition for runlevel : A runlevel is a software configuration of the system which allows only a selected group of processes to exist. The processes spawned by init command/process for each of these runlevels are defined in the /etc/inittab file.
Runlevels control services started by the initialization process. The number of runlevels and services started on those runlevels varies with Linux distributions.
Print print current runlevel using who command:
$ who -r  
Or
$ runlevel

Different linux/unix disterbution’s runlevels


Redhat Linux:

Red Hat as well as most of its derivatives uses runlevels like this.  

# 0 – Halt (Do not set initdefault to this option.)
# 1 – Single User Mode
# 2 – Multi-user, without NFS (The same as 3, if you do not have networking)
# 3 – Full Multi-user Mode
# 4 – Unused
# 5 – X11
# 6 – Reboot (Do not set initdefault to this option.)
  

Debian Linux :
Debian, as well as most of the distributions based on it, like Ubuntu, does not make any distinction between runlevels 2 to 5. See also the Debian FAQ on booting.
0 – Halt
1 – Single
2 – Full multi-user with display manager (GUI)
3 – Full multi-user with display manager (GUI)
4 – Full multi-user with display manager (GUI)
5 – Full multi-user with display manager (GUI)
6 – Reboot


SUSE Linux:
SUSE uses a similar setup as Red Hat :
0 – Halt
1 – Single
2 – Full multi-user with no networking
3 – Full multi-user NO display manager
4 – Not used/User definable
5 – Full multi-user with display manager (GUI)
6 – Reboot


Solaris
0 – operating system halted; (SPARC only) drop to OpenBoot prompt
S – single-user with only root filesystem mounted (as read-only)
1 – single-user mode with all local filesystems mounted (read-write)
2 – multi-user with most daemons started.
3 – multi-user, identical to 2 (runlevel 3 runs both /sbin/rc2 and /sbin/rc3), with filesystems exported, plus some other network services started.
4 – alternative multi-user, user defined
5 – shut down, power-off if hardware supports it
6 – reboot