How to change default runlevel on Rhel/Centos

On Rhel/Centos 7,  systemd uses “targets” instead of runlevels/etc/inittab is no more used by systemd to change the run levels.

Default runlevel can be set either by using the systemctl command or making symbolic link of runlevel targets to default target file

run the following to get your current runlevel
# systemctl get-default

Now, to see all available targets, run below
# systemctl list-units –type=target

To change to runlevel 3, run below (i’m currently on graphical i.e 5)
systemctl set-default multi-user.target

confirm by running
# systemctl get-default

test by rebooting your server

you can go back by running
# systemctl set-default graphical.target

Another method 

you can run the following
# ls -l /lib/systemd/system/runlevel*target
this will output all necessary targets from which you can proceed to link any of the targets to /etc/systemd/system/default.target as below

# ln -s /lib/systemd/system/runlevel3.target  /etc/systemd/system/default.target

check by
# systemctl get-default

and reboot

Leave a Reply

Your email address will not be published. Required fields are marked *