//go:build unix package daemon import ( "os/exec" "syscall" ) // detach detaches the child from the terminal: own session (no SIGHUP when // the terminal closes, no Ctrl-C from the shell). func detach(cmd *exec.Cmd) { cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} }