Merge pull request #48 from nightly-brew/detach-from-process-group

Use Setsid when spawning programs
This commit is contained in:
Piotr Miller
2022-01-15 03:58:52 +01:00
committed by GitHub

View File

@@ -15,6 +15,7 @@ import (
"regexp" "regexp"
"sort" "sort"
"strings" "strings"
"syscall"
"time" "time"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
@@ -578,6 +579,10 @@ func launch(command string, terminal bool) {
msg := fmt.Sprintf("env vars: %s; command: '%s'; args: %s\n", envVars, elements[cmdIdx], elements[1+cmdIdx:]) msg := fmt.Sprintf("env vars: %s; command: '%s'; args: %s\n", envVars, elements[cmdIdx], elements[1+cmdIdx:])
log.Info(msg) log.Info(msg)
cmd.SysProcAttr = &syscall.SysProcAttr {
Setsid: true,
}
cmd.Start() cmd.Start()
if *resident { if *resident {