Implement bd daemons killall and logs (bd-153, bd-152)

Amp-Thread-ID: https://ampcode.com/threads/T-f1cff202-188b-4850-a909-c2750d24ad22
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-26 19:03:00 -07:00
parent 43264dbf35
commit 7980b9c9e9
4 changed files with 361 additions and 4 deletions

View File

@@ -13,3 +13,16 @@ func killProcess(pid int) error {
}
return nil
}
func forceKillProcess(pid int) error {
if err := syscall.Kill(pid, syscall.SIGKILL); err != nil {
return fmt.Errorf("failed to send SIGKILL to PID %d: %w", pid, err)
}
return nil
}
func isProcessAlive(pid int) bool {
// On Unix, sending signal 0 checks if process exists
err := syscall.Kill(pid, 0)
return err == nil
}