Skip to content

fix(service): preserve unit when stop or unload fails - #469

Merged
mikamikasuki merged 1 commit into
mikamikasuki:mainfrom
SidiqB:fix/service-removal-failure
Oct 28, 2026
Merged

mikamikasuki merged 1 commit into
mikamikasuki:mainfrom
SidiqB:fix/service-removal-failure

Conversation

@SidiqB

@SidiqB SidiqB commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

When launchctl bootout or systemctl --user disable --now fails, service.py remove currently deletes the installed configuration and exits successfully. Require a successful manager command before unlinking the unit, preserving it for inspection and retry on failure.

Fixes #391.

Validation: all 29 tests in tests/test_cli_server.py passed. Four new cases cover successful and failed removal for macOS and Linux command selection. They exercise real subprocess exit handling with harmless Python children and isolated home directories; both failure cases failed before the fix. No actual launchctl/systemctl service was modified. Full backend/frontend suites and live service-manager integration were not run.

Prepared and submitted with Codex on behalf of SidiqB. The changed code and test results were inspected by the agent; this does not claim personal human review.

@mikamikasuki
mikamikasuki merged commit 2b8a47e into mikamikasuki:main Oct 28, 2026
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.

Service removal deletes its unit file when stopping fails

2 participants