Learn Steps

What are runlevels in linux systems?

Recently I came to know about the runlevels in linux while going through  initd. So I thought of writing about it and here it is what are runlevels in linux systems?

Run-levels are the mode in which you unix system boots up. These modes can be from single user with no networking to full fledge desktop like boot. There are 7 runlevels defined and these are numbered from 0-6.Following is the list of the runlevels.

These modes defines the features that your system can provide like if you boot up your systems in mode where networking is not enabled you won’t be able to connect your computer to other machines on the network. 

What are runlevels in linux systems?

Here is a list of runlevels in linux:

Run Level Mode What is does
0 Halt System Shutdown
1 Single User No network interfaces, start daemons, or allow non-root logins
2 Multi User No configure network interfaces or start daemons.
3 Multi User with Networking Starts the system normally.Like most of the servers with terminal
4 User defined Not used/User-definable
5 Multi User with display As most of the desktops are launched with display.
6 Reboot Reboots the system

These are standard runlevels and are used while init the system. 

There is a runlevel 4, which is custom and user can define the capabilities that the machine will provide when launched in that particular run-level. 

To see which runlevel your system is running in. Open terminal and type

runlevel

It will show the runlevel like below

These are used in initd to write startup init scripts. Initd is  the first process that gets launched when you boot up your machine and the process ID is 1. 

These runlevels are replace with target in systemd systems. You can read about them here. 

https://www.learnsteps.com/what-are-targets-in-systemd-how-is-it-mapped-to-runlevels-in-system-v/

Liked the article please share and subscribe.
You can also read more such articles below.

How to get number of threads per process?

 

How to get most frequent ip address in your logs.

Read more about containers here.