0% found this document useful (0 votes)
159 views2 pages

Linux Runlevels Explained

Runlevels determine what services are started or stopped on a Linux system and allow the user to control the system's behavior. There are 7 runlevels numbered 0-6, with each runlevel configured to start or stop certain services. Runlevel 3 is typically used for servers without a GUI, while runlevel 5 is used for servers and desktops with a graphical interface. Init scripts located in /etc/rc.d launch applications based on the default runlevel specified in /etc/inittab. The chkconfig tool is used to control which services are enabled or disabled for each runlevel.

Uploaded by

Cemalovic Lamija
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
159 views2 pages

Linux Runlevels Explained

Runlevels determine what services are started or stopped on a Linux system and allow the user to control the system's behavior. There are 7 runlevels numbered 0-6, with each runlevel configured to start or stop certain services. Runlevel 3 is typically used for servers without a GUI, while runlevel 5 is used for servers and desktops with a graphical interface. Init scripts located in /etc/rc.d launch applications based on the default runlevel specified in /etc/inittab. The chkconfig tool is used to control which services are enabled or disabled for each runlevel.

Uploaded by

Cemalovic Lamija
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Linux Runlevels Explained

A runlevel is one of the modes that a Unix -based operating system will run
in. Each runlevel has a certain number of services stopped or started, giving
the user control over the behavior of the machine. Conventionally, seven
runlevels exist, numbered from zero to six.

After the Linux kernel has booted, the init program reads the /etc/inittab file
to determine the behavior for each runlevel. Unless the user specifies another
value as a kernel boot parameter, the system will attempt to enter (start) the
default runlevel.

Run
Level Mode Action
0 Halt Shuts down system
Does not configure network interfaces, start
1 Single-User Mode daemons, or allow non-root logins
Does not configure network interfaces or start
2 Multi-User Mode daemons.
Multi-User Mode with
3 Networking Starts the system normally.
4 Undefined Not used/User-definable
5 X11 As runlevel 3 + display manager(X)
6 Reboot Reboots the system
Standard run levels for Red Hat based distributions

Most Linux servers lack a graphical user interface and therefore start in
runlevel 3. Servers with a GUI and desktop Unix systems start runlevel 5.
When a server is issued a reboot command, it enters runlevel 6.

Init scripts
Init (short for initialization) is the program on Unix and Unix-like systems that
spawns all other processes. It runs as a daemon and typically has PID 1.

The /etc/inittab file is used to set the default run level for the system. This is
the runlevel that a system will start up on upon reboot. The applications that
are started by init are located in the /etc/rc.d folder. Within this directory
there is a separate folder for each run level, eg rc0.d, rc1.d, and so on.

chkconfig
The chkconfig tool is used in Red Hat based systems (like CentOS) to control
what services are started at which runlevels. Running the command chkconfig
list will display a list of services whether they are enabled or disabled for
each runlevel.

root@host:~ # chkconfig --list


filelimits 0:off 1:off 2:on 3:on 4:on 5:on 6:off
syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
gpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off
cpanel 0:off 1:off 2:off 3:on 4:on 5:on 6:off
kudzu 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netplugd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rawdevices 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ipchains 0:off 1:off 2:on 3:on 4:on 5:on 6:off
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off
xfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
httpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off

Single User mode is a mode that a multi-user system (like a Linux server)
can be booted into the operating system as a superuser. Booting a system
into this mode does not start networking, but can be used to make changes to
any configuration files on the server. One of the most common usages for
single-user mode is to change the root password for a server on which the
current password is unknown.

Runlevels are an important part of the core of the Linux operating system.
While not something the average administrator will work with on a daily basis,
understanding runlevels gives the administrator another layer of control and
flexibility over the servers they manage.

You might also like