Demystifying Linux Runlevel with examples

In Linux Standard Base, there are seven different runlevels, numbered zero through six, we’ll go over each level briefly before focusing on level 3, which is typically the default runlevel for server systems.

  • Level zero will be halt, which will shut down the system. There are no services or processes running and the system is ready to be powered off.

  • Level 1 is a single user mode, which will be utilised for administrative tasks, with relatively few processes running, suffice to allow you to get in and perform maintenance tasks, such as recovering your system or changing your password.

  • The second level is multi-user mode, but it doesn’t offer any network interfaces or share any network services.

  • Level 3 is quite similar to the second, except it will include networking and usually referred to as multi-user mode with networking.

  • Level 4 is not used and is typically reserved for customised distribution or system configurations or left for users so they can create a runlevel to perform certain tasks for special purposes.

  • With level 5 , the system will generally boot up with the appropriate display manager, which means a GUI will be available. It will have the same features as runlevel 3, including network access, multi-user mode, and a graphical user interface.

  • Level 6 and final level is used to reboot the system. It halts the currently running system and then starts the boot process again, resulting in a system restart.

Depending on the unix distribution, the /etc/rc.d/ directory in Red Hat before to 7 and CentOS previous to CentOS 7 is where starting and shutdown scripts are located depending on the level of booting.

The subdirectories laied out inside this folder represent the booting level, we are going to take a close look at in the next blog post .

updatedupdated2024-01-172024-01-17