What is a runlevel ?
Runlevel is the preset state in which a Linux system operates. Below mentioned are the different runlevels of a Linux system in which a linux system can be operated
- 0- halt or shutdown
- 1- single user mode
- 2- multi user mode without NFS
- 3- full multi-user mode
- 4- not used
- 5- graphical mode
- 6- reboot
Change run level in centos 6
Method 1 – Change the run level at startup
Under Red Hat Enterprise Linux, it is possible to change the default runlevel at boot time.
To change the runlevel of a single boot session, use the following instructions:
- When the GRUB menu bypass screen appears at boot time, press any key to enter the GRUB menu (within the first three seconds).
- Press the a key to append to the kernel command.
- Add <space><runlevel> at the end of the boot options line to boot to the desired runlevel. For example, the following entry would initiate a boot process into runlevel 3:
grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet 3
Method 2 – Change the run level on Started Server/Desktop
Changing default runlevel in Centos/RHEL 6 is very easy task & requires a change in single file.
- Firstly, open file /etc/inittab
- vim /etc/inittab
- and you will get something like id:5:initdefault: in the file, where 5 is the default runlevel.
- You must change 5 to desired runlevel, which in this case is 3 (multi-user mode).
- After making changes to file, save it to change the default runlevel on boot.
- This will implement after reboot the machine.
Change run level in centos 7
In CentOS 7 / RHEL 7, systemd uses “targets” instead of run-levels. /etc/inittab is no more used by systemd to change the run levels.
Change default to runlevel 3 (nothing but a multi-user.target).
# systemctl set-default multi-user.target
Confirm the default runlevel.
# systemctl get-default multi-user.target
Reboot and check it out.
For any query or issue, feel free to discuss on http://discuss.eduguru.in