initctl: the status views over D-Bus

The summary table, the per-service detail, JSON and the quiet and
ident forms all read state Finit already publishes, so they read it
from the bus like everything else rather than through a second path
that has to be kept in step.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-08-13 09:28:26 +02:00
1 parent ebc0ef62e6
commit 6310d9e760
16 files changed
+1271 -315

No files matched your search

+25 -3
View File
@@ -2,9 +2,10 @@
# libink: org.finit.Service1 vtable + ServiceStateChanged signal.
#
# Covers per-service objects exposed at /org/finit/service/<encoded>:
# GetService lookup, Introspect on a service object, Service1.Restart,
# authorization (non-root rejected), and the Manager1.ServiceStateChanged
# signal that Service1.Restart triggers.
# GetService lookup, Introspect on a service object, Service1
# properties via Properties.Get, Service1.Restart, authorization
# (non-root rejected), and the Manager1.ServiceStateChanged signal
# that Service1.Restart triggers.
set -eu
@@ -29,6 +30,27 @@ case "$xml" in
fail "Service1 not visible on /org/finit/service/keventd: $xml" ;;
esac
say "Service1 properties: Identity, State, Pid"
ident=$(texec "$CLIENT" getprop "$BUS" /org/finit/service/keventd \
org.finit.Service1 Identity)
assert "Identity is keventd (got: $ident)" "$ident" = "keventd"
state=$(texec "$CLIENT" getprop "$BUS" /org/finit/service/keventd \
org.finit.Service1 State)
assert "State is running (got: $state)" "$state" = "running"
pid=$(texec "$CLIENT" getprop "$BUS" /org/finit/service/keventd \
org.finit.Service1 Pid)
assert "Pid is non-zero (got: $pid)" "$pid" -gt 0
say "Service1 properties are advertised in introspection XML"
case "$xml" in
*'<property name="Identity" type="s"'*'<property name="Pid" type="u"'*)
assert "Identity and Pid declared with types" 0 -eq 0 ;;
*)
fail "Property declarations missing from service XML" ;;
esac
say "Service1.Restart on /org/finit/service/keventd succeeds"
texec "$CLIENT" call-void "$BUS" /org/finit/service/keventd \
org.finit.Service1 Restart >/dev/null \