<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr"><br></div><div dir="ltr"><br><blockquote type="cite">On 10 Jan 2023, at 13:56, Markus Rathgeb <maggu2810@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div>Thank you both for your replies and suggestions.<br></div><div>I assume this one is related: <a href="https://github.com/systemd/systemd/issues/1312">https://github.com/systemd/systemd/issues/1312</a></div><div>And yes, I found a lot of posts about this, but no real solution.</div><div><br></div><div>I will further read further details about 'Upholds' and 'PropagatesStopTo. </div><div><br></div><div>The real use case I need to solve involves another service.</div><div><br></div><div>test2 not only requires test1 but also test0.</div><div>So, test2 should only be actived if test1 and test0 are activated.</div><div><br></div><div>The optimal solution IMHO does not require to change test0 or test1. As test2 is the one with the requirements.</div><div><br></div><div>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).<br></div></div>
</div></blockquote><br><div>WantedBy may not do what you think, see systemd.unit man page.</div><div><br></div><div><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-size: medium; background-color: rgb(255, 255, 255);">Note: </span><code class="varname" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><div class="__firefox__find-highlight" style="color: rgb(34, 34, 34); background-color: rgb(254, 255, 0); opacity: 0.5; border-radius: 1px; transition: all 100ms ease 100ms; display: inline;">WantedBy</div>=</code><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-size: medium; background-color: rgb(255, 255, 255);"> and </span><code class="varname" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">RequiredBy=</code><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-size: medium; background-color: rgb(255, 255, 255);"> are used in the [Install] section to create symlinks in </span><code class="filename" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">.wants/</code><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-size: medium; background-color: rgb(255, 255, 255);"> and </span><code class="filename" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">.requires/</code><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-size: medium; background-color: rgb(255, 255, 255);"> directories. They cannot be used directly as a unit configuration setting.</span></div><div><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-size: medium; background-color: rgb(255, 255, 255);"><br></span></div><div><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-size: medium; background-color: rgb(255, 255, 255);">Barry</span></div></body></html>