[systemd-devel] How to override (not augment) multi-value properties after including original service file?

Andrey Borzenkov arvidjaar at gmail.com
Sun Oct 28 03:05:12 PDT 2012


I have shipped service that has incorrect dependency so it never runs,
in this case After:

bor at opensuse:~/src/mkinitrd> grep
After /lib/systemd/system/purge-kernels.service
After=local_fs.target

If I now try to .include unit file in /etc, After is augmented:

bor at opensuse:~/src/mkinitrd>
cat /etc/systemd/system/purge-kernels.service
.include /lib/systemd/system/purge-kernels.service

[Unit]
After=local-fs.target

bor at opensuse:~/src/mkinitrd> systemctl show --no-pager -p After
purge-kernels.service
After=local_fs.target local-fs.target systemd-journald.socket
basic.target

Which is correct ... except this is exactly what I want to change in
this case :)

May be add something like this?

After-=local_fs.target

Or is the case far too exotic?

-andrey

P.S. and yet again - service that was never even attempted due to failed
dependencies is quite hard to spot. There is no error, it is not shown
in "systemctl --failed", it simply is not there. I miss some easy way to
ask "show me all services that are pulled in by current target but could
not be started for some reasons".



More information about the systemd-devel mailing list