omegafox/launcher/procgroup_unix.go
daijro 8e5144abe0 Launcher: Better process handling
- Automatically run chmod on linux & macos
- Manage camoufox with process group on unix
- Closing camoufox kills launcher, & vice versa
- Exclude useless warnings from output
- Make return code of launcher match camoufox process
2024-08-06 21:40:02 -05:00

17 lines
276 B
Go

//go:build !windows
// +build !windows
package main
import (
"os/exec"
"syscall"
)
func setProcessGroupID(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
}
func killProcessGroup(cmd *exec.Cmd) {
syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
}