manager: allow assignment of properties on target/swap/device units
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 16 Aug 2022 16:07:30 +0000 (18:07 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Aug 2022 22:08:37 +0000 (07:08 +0900)
commiteab62c01ef81adb85dbbb561b3102d1cf960f5b6
tree6765f7aa06432a72c5f0280bf955d44e5d098ae9
parente4e6cfaad04d93873bc542b072eea2f34e607a01
manager: allow assignment of properties on target/swap/device units

E.g. Documentation or Markers could apply to any unit type. This already worked
partially, because a direct dbus call could be made:

After rebuild with the patch, but before the manager has been restarted:
$ build/systemctl --user set-property dev-zram0.swap Markers=+needs-restart
$ build/systemctl --user show -p Markers dev-zram0.swap
Markers=needs-restart

I noticed that that the rpm unit restart helper was throwing errors for target
units. We should just let the Markers be set for those too, even if it doesn't
do anything in the end. This way we don't need to special-case by unit type.
src/core/dbus-unit.c
src/shared/bus-unit-util.c