//go:build linux package server import ( "sync" "syscall" ) var subreaperOnce sync.Once // enableLocalKillSubreaper marks the panel process as a Linux child subreaper // (PR_SET_CHILD_SUBREAPER) so orphaned descendants created via setsid, nohup, or // double-fork are reparented to this process instead of PID 1 and remain visible // for deterministic termination on Pause/Stop. func enableLocalKillSubreaper() { subreaperOnce.Do(func() { const prSetChildSubreaper = 36 _, _, _ = syscall.Syscall6(syscall.SYS_PRCTL, prSetChildSubreaper, 1, 0, 0, 0, 0) }) }