RHEL 7 systemd default.target question
Freshly installed minimal RHEL 7 system.
Systemd default target information seems to be in conflict.
I look at the symlink(s):
[root@bpb7a ~]# ls -l /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 37 Jun 30 13:42 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target
[root@bpb7a ~]# ls -l /usr/lib/systemd/system/default.target
lrwxrwxrwx. 1 root root 16 Jun 30 13:40 /usr/lib/systemd/system/default.target -> graphical.target
I ask systemctl:
[root@bpb7a ~]# systemctl get-default
multi-user.target
So, /etc rules, as it should. But what's going on in /usr/lib/systemd/system/ ... Any thoughts as on the disparity?
Thanks,
Brian
Responses
I assure you there's nothing unusual going on here. What you're seeing is normal.
At boot time: when control passes from the initramfs to systemd, the default.target is chosen by looking through the following things, in the following order:
-
Possible kernel argument/parameter of:
systemd.unit=SOMETHING.target -
Possible symlink of:
/etc/systemd/system/default.target -
Symlink of:
/usr/lib/systemd/system/default.target
To be clear: It is intended that the contents of /usr/lib/systemd/ are the same on every system (so the default target in systemd is graphical.target). Any local changes a sysadmin wants to make should be in /etc/systemd/ -- files there always take precedence over the distro files.
I would just like to add that the systemd unit locations and their precedence are briefly explained in the Red Hat Enterprise Linux 7 System Administrator's Guide, but we can certainly improve this piece of documentation if you think that this needs to be explained more clearly.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
