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 <francis.moro@xxxxxxxxx> wrote:
On Tue, Nov 10, 2020 at 11:30 AM Lennart Poettering
<lennart@xxxxxxxxxxxxxx> wrote:
>
> On Di, 10.11.20 10:28, Francis Moreau (francis.moro@xxxxxxxxx) 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
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
Arian van Putten l Software Engineer
@arian_wire on Wire
Wire - Secure team messaging.
Zeta Project Germany GmbH l Rosenthaler Straße 40, 10178 Berlin, Germany
Geschäftsführer/Managing Director: Morten J. Broegger
HRB 149847 beim Handelsregister Charlottenburg, Berlin
VAT-ID DE288748675
_______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel