Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to change run level in Linux (i.e. Red Hat / CentOS)?

user-image
Question added by Sajjad Haider Abbasi , Manager – IP Core Networks , Satcomm (Pvt) Ltd.
Date Posted: 2014/01/14
saroop malhi
by saroop malhi , Senior Network Engineer , LalsGroup

  • Runlevel0 is halt
  • Runlevel1 is single-user
  • Runlevels2-5 are multi-user
  • Runlevel6 is for rebooting system

For example, typing the init3 command will move system to run level3:

# init3

Mahmoud Mamdouh
by Mahmoud Mamdouh , Linux System Administrator (Remote position) , 2X4.ru

from CLI type :

#init LEVELNO

its very simple. 

 

login as root  and then execute the command

vi /etc/inittab

 

There you will find a line just like this. 

id:5:initdefault:

 

change the value1-5 depends on your need. Just as an example, the above line depicts that it will use run level5 which is primiarily used for GUI, you can change value to3 for multi user CLI. which is preferred for system admin tasks. 

 

# Default runlevel. The runlevels used are:

#  0 - halt (Do NOT set initdefault to this)

#  1 - Single user mode

#  2 - Multiuser, without NFS (The same as3, if you do not have networking)

#  3 - Full multiuser mode

#  4 - unused

#  5 - X11

#  6 - reboot (Do NOT set initdefault to this)

 

 once you have changed the value, then save this file and exit.. dont forget to reboot your linux box. 

 

 

Muhammad Anzar
by Muhammad Anzar , DevOps/DevSecOps Architect , Confidential

In Linux,6 run levels are available.  It is start from0 to6

 

For identifying current run level, enter following command

# who -r 

 

or 

#runlevel

 

For changing to any other runlevel, enter following command

#init <runlevel number>

 

For small description about6 runlevels

 

#  0 - halt (Do NOT set initdefault to this)

#  1 - Single user mode

#  2 - Multiuser, without NFS (The same as3, if you do not have networking)

#  3 - Full multiuser mode

#  4 - unused

#  5 - X11

#  6 - reboot (Do NOT set initdefault to this)

Hazem Hemaid
by Hazem Hemaid , Linux System Engineer , Training and Development Institute

just with root privilage write "init" before the level you want

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.