2026-10-24 09:49:16 +02:00
|
|
|
//go:build unix
|
|
|
|
|
|
|
|
|
|
package daemon
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os/exec"
|
|
|
|
|
"syscall"
|
|
|
|
|
)
|
|
|
|
|
|
2026-10-24 11:15:35 +02:00
|
|
|
// detach detaches the child from the terminal: own session (no SIGHUP when
|
|
|
|
|
// the terminal closes, no Ctrl-C from the shell).
|
2026-10-24 09:49:16 +02:00
|
|
|
func detach(cmd *exec.Cmd) {
|
|
|
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
|
|
|
|
|
}
|