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