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?

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

What are runlevels in linux systems?

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.


Gaurav Yadav

Gaurav is cloud infrastructure engineer and a full stack web developer and blogger. Sportsperson by heart and loves football. Scale is something he loves to work for and always keen to learn new tech. Experienced with CI/CD, distributed cloud infrastructure, build systems and lot of SRE Stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.