initctl: add the settings of a service to the JSON status

initctl -j status had the state of a service but little of how it is
set up.  A program reading it could not tell how the service is
stopped, what scripts it runs, or how it signals readiness.

Add the settings: stop, reload, notify, remain, scripts, directories,
cgroup-config, rlimits, log or tty, provides, conflicts, if, groups,
capabilities, pam, name, id, protected, and nowarn.  The restart
object also gets sec, respawn, and oncrash, and the state Finit keeps
for its own use goes in internal:

    "stop": {
      "signal": "SIGTERM",
      "timeout": 3,
      "scope": "pgroup"
    },
    "scripts": {
      "exec-stop-post": { "command": "/bin/true", "timeout": 7 }
    },

initctl reads the status over D-Bus first, so each setting is also a
property of org.finit.Service1.  The new test checks that the JSON is
the same over D-Bus as over the initctl socket.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-19 21:51:23 +01:00
1 parent 9fa50746a7
commit c94fd9c495
12 files changed
+893 -29

No files matched your search

+2
View File
@@ -73,6 +73,7 @@ EXTRA_DIST += run-task-tricks.sh
EXTRA_DIST += runparts.sh
EXTRA_DIST += sysvparts.sh
EXTRA_DIST += start-stop-service.sh
EXTRA_DIST += status-json.sh
EXTRA_DIST += start-stop-service-sub-config.sh
EXTRA_DIST += start-kill-service.sh
EXTRA_DIST += start-kill-stop.sh
@@ -148,6 +149,7 @@ TESTS += run-restart-forever.sh
TESTS += run-task-tricks.sh
TESTS += runparts.sh
TESTS += start-stop-service.sh
TESTS += status-json.sh
TESTS += start-stop-service-sub-config.sh
TESTS += start-kill-service.sh
TESTS += start-kill-stop.sh