[systemd-devel] service dependencies

Barry barry at barrys-emacs.org
Sat Jan 14 15:01:18 UTC 2023



> On 10 Jan 2023, at 13:56, Markus Rathgeb <maggu2810 at gmail.com> wrote:
> 
> 
> Thank you both for your replies and suggestions.
> I assume this one is related: https://github.com/systemd/systemd/issues/1312
> And yes, I found a lot of posts about this, but no real solution.
> 
> I will further read further details about 'Upholds' and 'PropagatesStopTo.
> 
> The real use case I need to solve involves another service.
> 
> test2 not only requires test1 but also test0.
> So, test2 should only be actived if test1 and test0 are activated.
> 
> The optimal solution IMHO does not require to change test0 or test1. As test2 is the one with the requirements.
> 
> I assume I can use WantedBy in the install section of test2, but this would require that the service is enabled / installed and not only started (for my use case okay, but IMHO not optimal).

WantedBy may not do what you think, see systemd.unit man page.

Note: WantedBy= and RequiredBy= are used in the [Install] section to create symlinks in .wants/ and .requires/ directories. They cannot be used directly as a unit configuration setting.

Barry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230114/03049545/attachment.htm>


More information about the systemd-devel mailing list