Skip to content

fix(setup): report failed user service installs - #699

Merged
vladimirrott merged 3 commits into
lacs-project:mainfrom
dannyward630:fix/issue-665-user-service-result
Oct 29, 2026
Merged

vladimirrott merged 3 commits into
lacs-project:mainfrom
dannyward630:fix/issue-665-user-service-result

Conversation

@dannyward630

@dannyward630 dannyward630 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #665

Summary

  • Return an accurate user-service installation result so setup reports incomplete service setup instead of success when systemd reload or startup fails.
  • Preserve manual recovery commands, and refuse to write a unit unless the daemon binary exists and is executable.
  • Document the setup outcome and cover successful install, reload failure, startup failure, missing binary, and non-executable binary paths.

Validation

  • node --test packages/setup/tests/user-daemon-mode.test.mjs — 4 passed, 1 skipped (Windows cannot check POSIX execute bits).
  • python scripts/check_evidence_claims.py — passed.
  • git diff --check — passed.
  • npm test --prefix packages/setup was attempted on Windows; the full suite hits POSIX-specific behavior and path assumptions.
  • GitHub Actions on head db7b9dd passed all 11 checks, including the Linux Rust and frontend CI jobs, both CodeQL analyses, and the setup package tests.

Assisted by OpenAI Codex (GPT-6).

@vladimirrott vladimirrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at db7b9ddc.

Danny, thank you. You closed both halves of #665, and you put the binary check ahead of every write: with no sysknife-daemon beside sysknife, the wizard now writes no unit and calls no systemctl.

I drove the real wizard (index.js --claude --no-binary --daemon-mode=user --no-prompts) in a container with stub systemctl and loginctl on PATH, at db7b9ddc and on main:

Scenario main this PR
enable --now fails Setup complete, exit 0 Setup incomplete: 1 step left, exit 3
daemon-reload fails Setup complete, exit 0 2 steps left, exit 3
no daemon binary unit pointing at a missing file, exit 0 no unit, exit 3
everything succeeds exit 0 exit 0

The setup suite passes in full offline (136 tests), on your head and on a trial merge with current main. I reverted install-daemon.js to main and all five of your tests failed. Then I broke one branch at a time: a start failure reported as installed, a reload failure falling through to enable, the X_OK check removed, the binary check refusing everything, the runner left out of systemctl(). Each one turned at least one of your tests red.

Nothing blocks. Merging.

Two optional notes, for a follow-up if you want them:

  • index.js has a headline for system, none and skip. A user service that failed to start falls back to "The daemon is not installed yet.", even though the unit exists. A user entry such as "The user service was written but did not start." would tell the reader what happened.
  • setup-contract.test.mjs pins exit 3 at the entry point for system, skip and none. A fourth case with { mode: 'user', daemonInstalled: false } would pin your fix there too.

You have now walked every failure path of the user-mode install, which is more than most people who run it. If you look after Linux machines anywhere that matters to you, I would like to hear how SysKnife holds up there. npx sysknife-setup gets you started, and the read-only side (sysknife doctor, sysknife history, sysknife audit verify) changes nothing on the host.

@vladimirrott
vladimirrott merged commit 2377d97 into lacs-project:main Oct 29, 2026
11 checks passed
vladimirrott added a commit that referenced this pull request Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
vladimirrott added a commit that referenced this pull request Oct 29, 2026
The middle digit moves because `sysknife-setup` now exits 3 and writes no
unit when `sysknife-daemon` is missing, where it used to print "Setup
complete" and exit 0 (#699). docs/release.md counts a run that used to
succeed and now fails as a compatibility break.

Also in this release: fuzz targets for the daemon's trust boundary,
`make install DESTDIR=`, LICENSE in every published package, required DCO
sign-off, the crates.io token off the command line, SECURITY.md response
times and supported versions, an assurance case, a VEX document, and
Dependabot on every lockfile.

Signed-off-by: Vladimir Rotariu <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

sysknife-setup prints "Setup complete" and exits 0 when the user-mode daemon service never started

2 participants