Skip to content

fix: use systemd for power actions - #26

Merged
alvins82 merged 1 commit into
mainfrom
agent/systemd-power-fix
Aug 14, 2026
Merged

alvins82 merged 1 commit into
mainfrom
agent/systemd-power-fix

Conversation

@alvins82

Copy link
Copy Markdown
Owner

What changed

  • Replace legacy init 0/init 6 invocations with systemctl --no-block poweroff/reboot.
  • Propagate power-command failures as HTTP 500 responses instead of returning false success.
  • Add a regression test for error propagation.

Why

On systemd 259, /sbin/init 0 exits with Excess arguments. without powering off. The previous route ignored that error, so the UI reported success and later reloaded the page.

Validation

  • Linux-targeted compilation succeeded for service and route/v1 with GOOS=linux GOARCH=amd64 CGO_ENABLED=0.
  • Native macOS test execution is not available because the package uses Linux-only mount APIs.

@alvins82
alvins82 merged commit 15cd30e into main Aug 14, 2026
1 check passed
@alvins82
alvins82 deleted the agent/systemd-power-fix branch August 14, 2026 22:06
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