I decided to move some non-critical for my usecases long-starting services to a separate deferred target so they shoudn't delay
multi-user.target and
graphical.target. So I created
Code:
root@localhost:/home/bodqhrohro# cat /etc/systemd/system/post-graphical-goodies.target
[Unit]
Description=Lazy-load goodies
Wants=graphical.target
and tried to override
WantedBy in chosen units to this target (
systemctl edit,
systemctl disable,
systemctl enable). For example, for
kdump-tools unit, that is wanted by
multi-user.target by default, I added the following drop-in:
Code:
[Install]
WantedBy=post-graphical-goodies.target
And they seem to be overridden well: after executing
systemctl reload, the following symlink in
/etc/systemd/system/multi-user.target.wants/ disappears. But after reboot it appears again, and both the default target and my custom one are in
WantedBy:
Code:
root@localhost:/home/bodqhrohro# systemctl show kdump-tools.service|grep WantedBy
WantedBy=multi-user.target post-graphical-goodies.target
Why? Is this directive cumulative, like
ExecStart? I tried to put an empty
WantedBy= line before the custom directive to reset it, but that doesn't help.