Add go-reaper integration for process reaping (#580)

* Add go-reaper integration for process reaping

* refactor: move reaper initialization to cmd_linux.go
This commit is contained in:
Boshi Lian 2025-05-18 00:14:47 -07:00 • committed by GitHub
parent b3ce6b10c1
commit 22ad31b127
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View file

@ -5,8 +5,14 @@ package main
import (
"os/exec"
"syscall"
reaper "github.com/ramr/go-reaper"
)
func init() {
go reaper.Reap()
}
func setPdeathsig(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM}
}