## Problem gt shutdown failed to stop orphaned daemon processes because the detection mechanism ignored errors and had no fallback. ## Root Cause stopDaemonIfRunning() ignored errors from daemon.IsRunning(), causing: 1. Stale PID files to hide running daemons 2. Corrupted PID files to return silent false 3. No fallback detection for orphaned processes 4. Early return when no sessions running prevented daemon check ## Solution 1. Enhanced IsRunning() to return detailed errors 2. Added process name verification (prevents PID reuse false positives) 3. Added fallback orphan detection using pgrep 4. Fixed stopDaemonIfRunning() to handle errors and use fallback 5. Added daemon check even when no sessions are running ## Testing Verified shutdown now: - Detects and reports stale/corrupted PID files - Finds orphaned daemon processes - Kills all daemon processes reliably - Reports detailed status during shutdown - Works even when no other sessions are running Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
36 KiB
Executable File
36 KiB
Executable File