From c1814c8a4ed16450bdaa57ae2b66a847fc96385e Mon Sep 17 00:00:00 2001 From: neeshy <60193883+neeshy@users.noreply.github.com> Date: Fri, 11 Dec 2020 13:34:11 +0000 Subject: [PATCH] Fix issue on *NIX where server dies when controlling terminal is closed (#517) --- os.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/os.go b/os.go index bac9fb24..4f6483c5 100644 --- a/os.go +++ b/os.go @@ -89,7 +89,9 @@ func init() { } func detachedCommand(name string, arg ...string) *exec.Cmd { - return exec.Command(name, arg...) + cmd := exec.Command(name, arg...) + cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} + return cmd } func pauseCommand() *exec.Cmd {