Skip to content

Add Linux service management and real systemd Docker tests - #99

Merged
archae0pteryx merged 4 commits into
mainfrom
worktree-linux-service
Nov 15, 2026
Merged

archae0pteryx merged 4 commits into
mainfrom
worktree-linux-service

Conversation

@archae0pteryx

@archae0pteryx archae0pteryx commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add native Linux systemd user-service management to the existing service tasks, preserving macOS launchd behavior and shared installation/configuration paths.
  • Support login startup, restart-on-failure, SIGHUP reload, operational file logs, provenance, and safe uninstall/purge. Lingering remains opt-in; no trust-store changes.
  • Validate the running manager's unit search paths and loaded definition identity before install/uninstall mutations. Permit absent identity only for a genuinely new installation, and verify effective identity again before restart.
  • Add an opt-in Docker test image that boots real systemd and runs the actual debug Linux binary under a non-root user manager. Docker is a test fixture, not a production deployment.
  • Launch each Docker test from its immutable build ID, with ownership-checked cleanup even when creation fails before returning a container ID.
  • Add mocked lifecycle/failure and runner regressions, run service shell tests in CI, and update architecture/operations docs.

Validation

  • timeout 300 task check </dev/null passed on the final tree: 418 Rust tests plus wrapper/service suites under sh, bash, and zsh.
  • timeout 300 task test:systemd </dev/null passed: twelve real-systemd tests covering unit validation/enablement, permissions, status, logs, synthetic CONNECT forwarding, reload, restart, crash recovery, update, capture preservation, uninstall/purge, caller-only XDG overrides, and shadowed searched directories.
  • Fake-Docker regressions cover immutable-image launch, success/failure/interruption cleanup, missing-CID recovery, build failure, foreign name collisions, command bounds, and exit-status preservation.
  • ShellCheck and diff whitespace checks passed. Test containers were removed.

Independent local review

Five findings were fixed: invisible caller-only unit directories, uninstall definition mismatch, shadowed installation identity, mutable Docker image-tag races, and missing-CID cleanup. The final user-authorized scoped verification of install/uninstall identity safety found no issues on e34e560788d0653a965ec06ad68e428c2a06063c and passed all 19 focused identity mocks. Unrelated Docker/package changes retained prior full local review coverage. No GitHub review bots were invoked.

Docker test boundary

The test target requires a trusted rootful Linux Docker daemon with cgroup v2. It runs a privileged container with a private cgroup namespace, no host-directory or Docker-socket mounts, no published ports, and loopback-only runtime networking. Cleanup removes generated captures and CA material. Base images and the Debian package snapshot are pinned. Real-systemd Docker tests remain opt-in, separate from the mocked CI suite.

@archae0pteryx
archae0pteryx merged commit 2878697 into main Nov 15, 2026
2 checks passed
@archae0pteryx
archae0pteryx deleted the worktree-linux-service branch November 16, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant