Linux Run Levels - Explained

A run level is one of the modes that the Unix-based operating system will run on. It is a state of init with respect to what services are available.

When a Linux system boots, it launches the init process. Init is responsible for launching the other process on the system. For example, when you start a Linux computer, the kernel starts to init and the init executes the startup scripts that will start your hardware.

However, there is not only one startup script init executes. There are multiple run levels with their own startup scripts. For example, one run-level may bring up networking and launch the GUI desktop; while another run-level leaves networking disabled and keep the GUI desktop. 

This means you can drop from GUI Desktop mode to text console mode with a single command. 

Run Level Name Description
0 Halt Shutdown the system along with all services
1 Single-User Mode Used for system maintenance like booting in recovery. Does not configure network interfaces, start daemons, or allow non-root logins.
2 Multi-User Mode (No Network Support) Used for maintenance and software testing. Do not configure network interfaces or start daemons.
3 Multi-User Mode (Network Support) Starts the system normally i.e., non-graphical text mode operations for server systems.
4 Undefined Not defined/user-defined, used by SysAdmin.
5 Graphical Mode (X11) Graphical management with the same usability as Run Level 3.
6 Reboot Reboots the system

The applications that are started by init are located in the /etc/rc.d folder. There is a separate folder for each run level, i.e., rc0.d, rc1.d, and so on under this directory.

To initiate a run-level, in a terminal type, init <run_level_number>. For example, to reboot the command will be init 6. 

We hope this helps. If any suggestions or doubts you can add a comment and we will reply as soon as possible.

No comments:

Post a Comment