From eae9a5493202e9cb997e5b5991e98defa95d5001 Mon Sep 17 00:00:00 2001 From: yeti Date: Tue, 31 Mar 2026 03:03:29 +0000 Subject: [PATCH] fix: return unexpected errors from IsActive and IsEnabled The fallthrough error paths in both functions returned false, nil for all errors, silently swallowing failures like systemctl not found, permission denied, or unknown exit codes. Change to return false, err so callers can distinguish "unit is not active/enabled" from "we couldn't determine the state". Co-Authored-By: Claude Opus 4.6 (1M context) --- systemd/runner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systemd/runner.go b/systemd/runner.go index 269d848..92348c5 100644 --- a/systemd/runner.go +++ b/systemd/runner.go @@ -49,7 +49,7 @@ func (r *DefaultSystemctlRunner) IsActive(unit string) (bool, error) { return false, nil } } - return false, nil + return false, err } return true, nil } @@ -64,7 +64,7 @@ func (r *DefaultSystemctlRunner) IsEnabled(unit string) (bool, error) { return false, nil } } - return false, nil + return false, err } return true, nil }