fix: use Signal(0) for process polling in daemonRunStop
Some checks failed
Deploy / build (push) Failing after 3s
Security Scan / security (push) Successful in 12s

Consistent with cmd/service stopDaemon — polls process directly
instead of PID file removal to avoid PID reuse false positives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Snider 2026-03-09 15:16:20 +00:00
parent 79e6587d8a
commit 48c3f08bcb

View file

@ -170,7 +170,9 @@ func daemonRunStop(cfg DaemonCommandConfig) error {
deadline := time.Now().Add(30 * time.Second)
for time.Now().Before(deadline) {
if _, still := process.ReadPID(cfg.PIDFile); !still {
if err := proc.Signal(syscall.Signal(0)); err != nil {
// Process is gone — clean up PID file if it lingers.
_ = os.Remove(cfg.PIDFile)
LogInfo("Daemon stopped")
return nil
}