I think what you might want is `Type=exec` instead of `Type=simple` in your
unit file.  It was recently added to systemd.

then `systemctl restart` will return a failure when the main process fails
to start. I hope that helps.



On Tue, Nov 10, 2020 at 11:50 AM Francis Moreau <[email protected]>
wrote:

> On Tue, Nov 10, 2020 at 11:30 AM Lennart Poettering
> <[email protected]> wrote:
> >
> > On Di, 10.11.20 10:28, Francis Moreau ([email protected]) wrote:
> >
> > > Hello,
> > >
> > > After restarting a service with "systemctl try-restart ..." I want to
> > > verify that the service has been restarted.
> > >
> > > How can I reliably do this without using the dbus API ?
> >
> > D-Bus is how systemd exposes its state. If you don't want to use that,
> > you won't get the state information.
> >
>
> dbus is overkill for my little bash script.
>
> --
> Francis
> _______________________________________________
> systemd-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>


-- 

Arian van Putten  l  Software Engineer

@arian_wire on Wire

Wire <https://wire.com/en/download/> - Secure team messaging.

 Zeta Project Germany GmbH  l  Rosenthaler Straße 40, 10178 Berlin, Germany
<https://maps.google.com/?q=Rosenthaler+Stra%C3%9Fe+40,%C2%A0+10178+Berlin,%C2%A0+Germany&entry=gmail&source=g>


Geschäftsführer/Managing Director: Morten J. Broegger

HRB 149847 beim Handelsregister Charlottenburg, Berlin

VAT-ID DE288748675
_______________________________________________
systemd-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to