<div dir="ltr"><div>I think what you might want is `Type=exec` instead of `Type=simple` in your unit file. It was recently added to systemd.<br></div><div><br></div><div>then `systemctl restart` will return a failure when the main process fails to start. I hope that helps.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 10, 2020 at 11:50 AM Francis Moreau <<a href="mailto:francis.moro@gmail.com">francis.moro@gmail.com</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">On Tue, Nov 10, 2020 at 11:30 AM Lennart Poettering<br>
<<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>> wrote:<br>
><br>
> On Di, 10.11.20 10:28, Francis Moreau (<a href="mailto:francis.moro@gmail.com" target="_blank">francis.moro@gmail.com</a>) wrote:<br>
><br>
> > Hello,<br>
> ><br>
> > After restarting a service with "systemctl try-restart ..." I want to<br>
> > verify that the service has been restarted.<br>
> ><br>
> > How can I reliably do this without using the dbus API ?<br>
><br>
> D-Bus is how systemd exposes its state. If you don't want to use that,<br>
> you won't get the state information.<br>
><br>
<br>
dbus is overkill for my little bash script.<br>
<br>
-- <br>
Francis<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><span><p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style="font-size:12pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap">Arian van Putten</span><span style="font-size:12pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:12pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">l Software Engineer</span><span style="font-size:12pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"></span></p><p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style="font-size:9.5pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">@arian_wire o</span><span style="font-size:9.5pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">n Wire</span></p><p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt"><a href="https://wire.com/en/download/" target="_blank"><span style="font-size:9.5pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Wire</span></a><span style="font-size:9.5pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> - Secure team messaging.</span></p><p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style="font-size:9.5pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:9.5pt;font-family:Arial;color:rgb(204,204,204);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap">Zeta Project Germany GmbH </span><span style="font-size:9.5pt;font-family:Arial;color:rgb(204,204,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">l </span><a href="https://maps.google.com/?q=Rosenthaler+Stra%C3%9Fe+40,%C2%A0+10178+Berlin,%C2%A0+Germany&entry=gmail&source=g" target="_blank"><span style="font-size:9.5pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Rosenthaler Straße 40, 10178 Berlin, Germany</span></a><span style="font-size:9.5pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> </span></p><p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style="font-size:9.5pt;font-family:Arial;color:rgb(204,204,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Geschäftsführer/Managing Director: Morten J. Broegger</span></p><p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style="font-size:9.5pt;font-family:Arial;color:rgb(204,204,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">HRB 149847 beim Handelsregister Charlottenburg, Berlin</span></p><p dir="ltr" style="line-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style="font-size:9.5pt;font-family:Arial;color:rgb(204,204,204);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">VAT-ID DE288748675</span></p></span></div></div>