[systemd-devel] Monitoring whether all dependencies of a target are active
Reto Kaiser
reto at cargomedia.ch
Fri Aug 26 14:25:40 UTC 2016
Thanks for the gist, quite helpful!
Regards,
Reto
On Fri, Aug 26, 2016 at 2:40 PM, Mantas Mikulėnas <grawity at gmail.com> wrote:
> On Fri, Aug 26, 2016 at 3:12 PM, Reto Kaiser <reto at cargomedia.ch> wrote:
>>
>> Yes I was thinking to use "OnFailure".
>> But I want to also detect stopped units, in case a program or a person
>> stops a unit and forgets about it. That metric should tell me if all
>> my "important units" are active or not.
>>
>> I can live with iterating over the output of "list-dependencies". But
>> since its output is not meant to be read by machines, I thought maybe
>> there's a more machine-readable API.
>
>
> The machine-readable API is D-Bus. See
> <https://www.freedesktop.org/wiki/Software/systemd/dbus/> for (slightly
> outdated) documentation, in particularly ListUnits(). See
> <https://gist.github.com/grawity/8ec1cc03e8aec46baa820bfc76121879> for an
> example.
>
> --
> Mantas Mikulėnas <grawity at gmail.com>
More information about the systemd-devel
mailing list