ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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

user-image
تم إضافة السؤال من قبل Sajjad Haider Abbasi , Sr. Manager NOC & Support , Global Connect Synergy
تاريخ النشر: 2014/01/14
saroop malhi
من قبل 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
من قبل 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
من قبل 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
من قبل Hazem Hemaid , Linux System Engineer , Training and Development Institute

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

المزيد من الأسئلة المماثلة