[systemd-devel] service dependencies
Kevin P. Fleming
lists.systemd-devel at kevin.km6g.us
Tue Jan 10 12:01:23 UTC 2023
On Tue, Jan 10, 2023, at 06:47, Markus Rathgeb wrote:
>
> How can I declare test2 unit section to ensure it works as expected by me?
>
There are lots of StackOverflow posts about this... it's not as easy as it seems, so don't feel concerned that your attempt did not work :-)
If you are using a new enough version of systemd, the 'Upholds' and 'PropagatesStopTo' settings for test1, referring to test2, will do what you want. When test1 is running, systemd will ensure that test2 is running as well (and will stop test1 is test2 cannot be started), and if test1 is stopped (for any reason) systemd will stop test2 as well.
test2 will still need Requisite and After settings referring to test1.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230110/2719df08/attachment.htm>
More information about the systemd-devel
mailing list