Fix daemon exiting after 5s on macOS due to PID 1 parent monitoring (GH #278)

Amp-Thread-ID: https://ampcode.com/threads/T-87e6732c-f7bf-4e8d-9ebc-f778ac6f0c40
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-10 10:22:03 -08:00
parent 811eb46b03
commit 9e9db62954

View File

@@ -83,8 +83,9 @@ func checkParentProcessAlive(parentPID int) bool {
}
if parentPID == 1 {
// Adopted by init - parent died
return false
// Adopted by init/launchd - this is normal for detached daemons on macOS/Linux
// Don't treat this as parent death
return true
}
// Check if parent process is running