[systemd-devel] non-existent unit instances
Kevin P. Fleming
kevin at km6g.us
Sun Sep 6 13:24:13 UTC 2020
On Sat, Sep 5, 2020 at 9:50 AM Michael Chapman <mike at very.puzzling.org> wrote:
> Since the instance name for this unit is used to derive a configuration
> filename, a simple solution here would be to use:
>
> ConditionPathExists=/etc/openvpn/client/%i.conf
>
> in the unit. Or, if you want the start job to fail when given a bad
> instance name:
>
> AssertPathExists=/etc/openvpn/client/%i.conf
Thanks for this tip, this is very useful! I have a number of service
units which launch scripts and those scripts will fail if their
configuration files are not present; it will be handy to have the
start job itself fail in this situation.
More information about the systemd-devel
mailing list