Linux Runlevels or init functions

 Linux Runlevels: 

In Linux we have some administration runlevels which are mostly used to maintain the state of Linux Operating system.  
 

  • Whenever a LINUX system boots, firstly the init process is started which is actually responsible for running other start scripts which mainly involves initialization of your hardware, bringing up the network, starting the graphical interface. 

  • Now, the init first finds the default runlevel of the system so that it can run the start scripts corresponding to the default run level. 

We have a total of 7 runlevels, from runlevel 0 to runlevel 6 total 7 levels. 

 

We can find runlevel details in “/etc/inittab” file in Linux. 

 

Runlevel 0 or init 0: 

Runlevel0/init 0 is used to shut down the Linux operating system. 


Runlevel1 or init 1: 

Runlevel 1 or init 1 is called single user mode and it is used for recovery of OS if anything goes wrong. 

Features: 

  1. No networking, 

  1. No GUI 

  1. Only one shell access. 

  1. No login password required 

*Note: If you forgot your root password and want to reset the same. We can make use of single user mode and reset the root password. 

* How to enter into single user mode: 

Once you start your linux server, while it's booting, we will get a status bar for booting. We need to interrupt the booting process by pressing any keys on keyboard. In the next page we need to press (‘a’ key for append or add) then we will get the option rhgb quite option ( rhgb - red hat graphical boot). 

Here we have to give runlevel which we want to give ex 1, That will take us to runlevel1. 


 Runlevel2 or init 2:  

It is a multi-users mode but doesn't have NFS (NFS is a File server, used to share the files). 

Features: 

  1. Multi-user and Multi-shell login mode 

  1. Networking present 

  1. No GUI 

  1. No NFS 


Runlevel3 or init 3: 

This runlevel is used in almost all types of servers, because it has Multi-users, Multi-shell login and has Networking, NFS enabled. GUI disabled. 

Features: 

  1. Multi-user and Multi shell login 

  1. Networking present 

  1. NFS present 

  1. No GUI. 


Runlevel 4 or init 4: 

This is mostly like runlevel 3 and used for testing purposes. 


Runlevel 5 or init 5: 

This runlevel has every feature in it, including GUI. 


Runlevel 6 or init 6: 

This runlevel is used for restarting.  

 

Comments

Popular posts from this blog

🔍 Why You Only See a Private IP Inside an AWS EC2 Instance — Even If It Has a Public IP

A Day in the Life of a DevOps Engineer – Roles & Responsibilities

Docker and Its Usage in DevOps – A Complete Guide