//go:build unix package daemon import ( "os/exec" "syscall" ) // detach detaches the child from the terminal (the breakaway flag is a // Windows concept and ignored here): own session (no SIGHUP when // the terminal closes, no Ctrl-C from the shell). func detach(cmd *exec.Cmd, _ bool) { cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} }