[systemd-devel] Monitoring whether all dependencies of a target are active

Mantas Mikulėnas grawity at gmail.com
Fri Aug 26 12:40:30 UTC 2016


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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160826/24a69e4d/attachment.html>


More information about the systemd-devel mailing list