<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 25, 2019 at 3:13 PM Jörg Weinhardt <<a href="mailto:jw@ib-weinhardt.de">jw@ib-weinhardt.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
the behavior of systemd is not quite clear to me:<br>
I have a service which requires another service to be started and running,<br>
so I use a Requires= dependency to the required service.<br>
But if the required service does not exist at all, there is no error message from systemd.<br>
e.g. <br>
<br>
Requires=xyz.service <br>
<br>
produces no complaint and starts the service even if there is no xyz.service<br>
Is this the normal behavior or can I configure systemd to throw an error in this case?<br></blockquote><div><br></div><div>The docs say you can get this behavior if you also have After=xyz.service. (Not entirely sure why.)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
If I write<br>
"Requires=xyz"<br>
<br>
there will be a message: Failed to add dependency on xyz, ignoring: Invalid argument<br>
Does that error mean that "xyz" is not a valid unit name?<br></blockquote><div><br></div><div>It's not a valid unit name if it doesn't have a ".type" suffix.</div><div><br></div><div>`systemctl start xyz` will just auto-expand it to xyz.service or something that makes sense for systemctl, but systemd's configuration files do not accept such shortcuts.</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>