Search tutorial by keyword

How to change Run Levels of Linux


Run levels is an important part of Linux as it defines the amount and type of services you want to enable on your server. Greater the run level greater the services are and smaller the run level the limited the services are. Run level 3 is an optimum run level to use a server with medium level privileges and services

If you want to check at which run level you are use the following command

#who –r 

An expected sample output will be as follows

run-level 2  2015-03-24 11:30                   last=S

When the server boots up the first process that is spawned and is responsible for getting the child processes to run is init so if you want to change the run level you must be familiar that what the functions of each run level are. If you want to change the run level when running the server you can just write init followed by the required run level but first we should be familiar with the description of run levels. 

Runlevel 0 is halt

Runlevel 1 is single-user

Runlevels 2-5 are multi-user (some distro uses RUN level 5 to start X [KDE/Gnome])

Runlevel 6 is for rebooting system


So if we write a command 

#init 3 

It will boot into run level 3 but if we want our settings to be persistent then we have to make changes in a file 

#vi /etc/inittab

Goto the line of id:5:default: 

And change 5 to the desired run level and reboot the machine. After that you will be booted to the required run level

Michael Dudli

Cloud Specialist with more than 10 years experience in the Hosting Business.