systemctl get-default differs from link

The default target returned by systemctl

[user@host system]$ systemctl get-default

differs from the value of the /usr/lib/systemd/system/ link:

[user@host system]$ ls -l /usr/lib/systemd/system/
lrwxrwxrwx. 1 root root 16 Mar 10 21:20 /usr/lib/systemd/system/ ->

My understanding was that these were one and the same. If systemd doesn’t store the default value as the symlink, where is the real value of the default target stored by systemd?

Asked By: petehern


This is most likely because /etc/systemd/system/ exists and points to

If you change the with systemctl set-default [unit], the new link is created in /etc/systemd/system/. The existing /usr/lib/systemd/system/ is not changed when using the set-default command. Like with all systemd units, the ones in /etc take precedence over /usr.

Answered By: Munir

systemd FAQ on “How do I change the default runlevel to boot into?“:

The symlink /etc/systemd/system/ controls where we boot into by default.

When default target isn’t configured, the default one in /usr/lib/systemd/system/ is used.

Answered By: sebasth
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.