chiark / gitweb /
systemd,systemctl: export condition status and show failing condition
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 25 Jun 2013 20:09:07 +0000 (16:09 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 18 Jul 2013 03:41:10 +0000 (23:41 -0400)
commit52990c2e0eabd1c11280f553f858062d4165b92f
tree68a522509cc2b3aa8c89835459bf618e3b7a6d74
parent4b744dfabebd10bf0f13b64060f44b1bd6c82704
systemd,systemctl: export condition status and show failing condition

$ systemctl --user status hoohoo
hoohoo.service
   Loaded: loaded (/home/zbyszek/.config/systemd/user/hoohoo.service; static)
   Active: inactive (dead)
           start condition failed at Tue 2013-06-25 18:08:42 EDT; 1s ago
           ConditionPathExists=/tmp/hoo was not met

Full information is exported over D-Bus:
  [(condition, trigger, negate, param, state),...]
where state is one of "failed" (<0), "untested" (0), "OK" (>0).
I've decided to use 0 for "untested", because it might be useful to
differentiate different types of failure later on, without breaking
compatibility.

systemctl shows the failing condition, if there was a non-trigger
failing condition, or says "none of the trigger conditions were met",
because there're often many trigger conditions, and they must all
fail for the condition to fail, so printing them all would consume
a lot of space, and bring unnecessary attention to something that is
quite low-level.
TODO
src/core/condition.c
src/core/condition.h
src/core/dbus-unit.c
src/core/dbus-unit.h
src/core/unit.c
src/systemctl/systemctl.c