Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx9FNLG2CqeBbVGGd9bFsP
17 lines
471 B
Go
17 lines
471 B
Go
//go:build linux
|
|
|
|
package vmsup
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
// sysProcAttr puts the child in its own process group and has the kernel kill
|
|
// it if nmon dies. Pdeathsig fires when the thread that forked exits, so the
|
|
// supervisor goroutine that starts children stays locked to its thread.
|
|
func sysProcAttr() *syscall.SysProcAttr {
|
|
return &syscall.SysProcAttr{Setpgid: true, Pdeathsig: syscall.SIGKILL}
|
|
}
|
|
|
|
func killGroup(pid int) { _ = syscall.Kill(-pid, syscall.SIGKILL) }
|