I am trying to understand if there is a way to create a soft dependency between systemd services. Basically, I'd like to create an "umbrella" service that starts other services marked as (soft-) dependencies, but if and only if they are enabled -- the umbrella should never start a dependant service that is disabled.
More specifically, I have received a pull request for cfengine-systemd that aims to create such an umbrella unit. Unfortunately, the proposed cfengine3.service
unit doesn't honour the enabled/disabled state of the dependant units and starts them in any case.
I had tried myself to do the same previously by means of a target unit, but failed shamefully.
Any clues?
Thanks in advance
Update following Michael's question: I would say that if cfengine3.service
is disabled, systemd should not try to start the dependant services.