mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-12-02 04:33:56 +08:00
The v0.7.1 release failed in its darwin binaries job: killswitch_unix.go is built for every unix target but calls syscall.SYS_PRCTL, which only exists on Linux. The Linux CI never compiled another GOOS, so the tag passed CI and broke the release build after the push. Move the prctl call to killswitch_prctl_linux.go, keep a no-op for the other unix targets, and add a cross-compile step to the go job so darwin and windows break in CI instead of in the release.
22 lines
569 B
Go
22 lines
569 B
Go
//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)
|
|
})
|
|
}
|