The default target returned by systemctl

[user@host system]$ systemctl get-default

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

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

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

  • 2
    Did you check /etc/systemd/system/ for an alternate default.target? It might be pointing to multi-user.target in there. – Munir Aug 8 '17 at 18:57

This is most likely because /etc/systemd/system/default.target exists and points to multi-user.target

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

| improve this answer | |

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

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

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.