Re: How can I simply check that a service has been restarted ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mi, 18.11.20 09:15, Francis Moreau (francis.moro@xxxxxxxxx) wrote:

> >
> > Eg:
> >
> > $ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/gdm_2eservice org.freedesktop.systemd1.Service NRestarts
> > u 0
> >
>
> I didn't know NRestart property, thanks. But it only counts automatic
> restart, not manual one.
>
> And also there's no need to use busctl, for getting service properties
> I can use 'systemctl show -p'

I am not sure what you even mean by "has been restarted"? Compared to
when?

You could enquire the invocation ID of the service at two points in
time, and if it changed in between the service got restarted.

      $ busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/gdm_2eservice org.freedesktop.systemd1.Unit InvocationID

The invocation is randomly generated whenever a new start cycle begins.

Lennart

--
Lennart Poettering, Berlin
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux