schema-dbus: on-demand service activation - #113
Merged
Conversation
Full auto-activation (implicit + explicit StartServiceByName), broker forks+execs directly, matches stock dbus-daemon semantics with env/fd/uid sanitization. Covers the 43-service (b1) regression set by mechanism. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
10 tasks: pure-logic table (parse + pending state machine, TDD unit-tested), then broker wiring — spawn helper, implicit trigger, SIGCHLD reaper, release on name-acquire, spawn timeout, explicit StartServiceByName. vmtest-gated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Caller wired in the next commit; transient unused-function warning until then. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Also fail closed in spawn_service when User= cannot be resolved (never silently exec as root) — from the commit security review of the prior commit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
Intercepts StartServiceByName in the driver path: ALREADY_RUNNING if owned, ServiceUnknown if not activatable, else spawn + hold EXPLICIT and reply SUCCESS on name-acquire. arg0 read via dbus_message_get_args (codec exposes DBusMessage, not a parsed args array). Adds SCHEMA_DBUS_SVCDIR env override for test/vmtest. Live smoke (scratch bus) confirms: explicit u1/u2, ServiceUnknown, ChildExited on failed drop, and implicit method-call spawn+hold+deliver. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gives the schema-dbus broker on-demand bus activation — closing the last functional gap after the flip. A method call to an unowned-but-activatable name (or an explicit
StartServiceByName) now spawns the service, holds the triggering message, and delivers it once the name is claimed.Why
Live audit: 43 services (the b1 set — mostly KDE kauth/polkit helpers plus fwupd, PackageKit, ColorManager, GeoClue2, bolt, fprintd, RealtimeKit1, ModemManager1) are direct-activated on demand by stock dbus-daemon and went dark under the broker (
StartServiceByNamewas a stub). This builds the general mechanism; all 43 are covered.Design
StartServiceByName.User=(fail-closed if unresolvable),DBUS_STARTER_*env, CLOEXEC fd hygiene.Spec:
docs/superpowers/specs/2026-09-04-schema-dbus-activation-design.mdPlan:
docs/superpowers/plans/2026-09-04-schema-dbus-activation.mdWhat's here
sdbus_activate.h— service-file table parser + pending-activation state machine (pure logic, unit-tested).schema-dbus.c—spawn_service(fork+exec, fail-closed uid drop), implicit trigger at the synth branch,signalfd(SIGCHLD)reaper, release-on-name-acquire, spawn-timeout reaping, explicitStartServiceByName,SCHEMA_DBUS_SVCDIRtest override.Verification
make test— full suite green incl. newtest_sdbus_activate(parse + state machine).u 1(SUCCESS) /u 2(ALREADY_RUNNING),ServiceUnknownfor non-activatable,Spawn.ChildExitedwhen the drop fails, and implicit method-call spawn→hold→deliver (real reply routed back from the spawned service).schema-vmtestPASS — schema-init PID 1 boots clean, no init regression.Not deployed to the live bus yet — hardware deploy + reboot pending.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ACQXzjkwWQcHibMgBh5WxK