]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/install: ignore aliasing failure when doing presets
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 4 Jan 2026 14:10:42 +0000 (15:10 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 4 Jan 2026 18:06:37 +0000 (03:06 +0900)
commit8a27100d0696d971525efcd8e59b504f56a0b6f8
tree7b11b4b913f94a4e0e80a13604e03d413a77c411
parentc1f873b4f499699fc58ef2dfc0d48f508355cf08
shared/install: ignore aliasing failure when doing presets

In recent Fedora, preset-all fails:
[  155s] Failed to preset unit: File '/buildroot/etc/systemd/user/dbus.service'
         already exists and is a symlink to /usr/lib/systemd/user/dbus-broker.service
[  155s] ‣ "systemctl --root=/buildroot --global preset-all" returned non-zero exit code 1.

Strictly speaking, this is an error in configuration. The presets specify that
both dbus-broker.service and dbus-daemon.service shall be enabled and they both
claim the 'dbus.service' alias. But this kind of error is very easy to make.
Failing the preset operation is too harsh, since in most cases the system will
work fine without an alias and changes in unrelated components can cause the
conflict.

Let's reuse the same logic that was added in
ad5fdd391248432e0c105003a8a13f821bde0b8e: when enabling the unit through
'preset' or 'preset-all', print the message, but suppress the error. When
enabling through 'enable', fail the operation.
src/shared/install.c