How to change Systemd Runlevel/Target in CentOS/Fedora

Fedora Linux is using systemd to manage system service. The /etc/inittab is no longer used by systemd. The old method of editing /etc/inittab to change system runlevel does not work anymore.

systemd uses ‘targets’ instead of runlevels. By default, there are two main targets: analogous to runlevel analogous to runlevel 5

To set a default target, run:

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

Change the runlevel to ‘multi-user’ (3):

# rm -f /etc/systemd/system/; ln -s /lib/systemd/system/ /etc/systemd/system/

Change the runlevel to ‘graphical’ (5):

# rm -f /etc/systemd/system/; ln -s /lib/systemd/system/ /etc/systemd/system/

For old system, to change the runlevel of the server upon boot up edit the /etc/inittab

sudo vi /etc/inittab

Around line 18 you will see a line as shown below.


You simply change the "5" in this case to the runlevel you desire. (In my case 3) Save the file and exit.


Popular posts from this blog

Check MySQL query history from command line

Installing chocolatey on Windows

Fixed: ImportError: No module named