Re: service dependencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux