Improvements based on oracle code review: - Move socket cleanup AFTER lock acquisition (prevents unlinking live sockets) - Add PID liveness check before removing stale socket - Add stale lock detection with retry mechanism - Tighten directory permissions to 0700 for security - Improve socket readiness probing with shorter timeouts - Make removeOldSocket() ignore ENOENT errors Fixes race condition where socket could be removed during daemon startup window, potentially orphaning a running daemon process. Amp-Thread-ID: https://ampcode.com/threads/T-63542c60-b5b9-4a34-9f22-415d9d7e8223 Co-authored-by: Amp <amp@ampcode.com>
28 KiB
28 KiB