I have noticed that unit_file_preset_all() in src/core/main.c creates a duplicate symb link for a rsyslog service. rsyslog.service looks like this:
# cat /usr/lib/systemd/system/rsyslog.service
Description=System Logging Service
ExecStartPre=-/bin/systemctl stop systemd-kmsg-syslogd.service
ExecStart=/usr/sbin/rsyslogd -n -c5
systemd-delta shows that we have extra link popping up in /etc
[EQUIVALENT] /etc/systemd/system/syslog.service -> /usr/lib/systemd/system/syslog.service
1 overridden configuration files found.
And both of the are pointing to the same file:
# readlink /etc/systemd/system/syslog.service
# readlink /usr/lib/systemd/system/syslog.service
The [Install] section contains two stanzas, so I would expect two symlinks. One to pull in rsyslog.service into m-u.target, and the other one two cause rsyslog.service to be linked to with the syslog.service name.
Are you talking about the symlink /usr/lib/systemd/system/syslog.service? I don't think systemctl or systemd create it, maybe it comes from the packaging system?
All the things that are in [Install] are available in /usr/lib/ before systemd boots (in the file system). When systemd boots, it decides to create (by unit_file_preset_all() function) "/etc/systemd/system/syslog.service" even though we have "/usr/lib/systemd/system/syslog.service" in the file system.
Note: It doesn't create link under /etc/systemd/system/multi-user.target.wants. Somehow it is smart to understand that there is already a link in /usr/lib/systemd/system/multi-user.target.wants.
I suspect, we are failing on Alias= somehow.