diff --git a/linux/run.go b/linux/run.go index 52b0469..d2f761e 100644 --- a/linux/run.go +++ b/linux/run.go @@ -76,6 +76,7 @@ func (cmd *LinuxCommand) Run() error { } command := exec.Command(cmd.Options.Shell, "-c", sourceCommand.String()+cmd.Options.Command+commandOptions.String()) + command.SysProcAttr = &unix.SysProcAttr{Setsid: true} command.Dir = cmd.Options.Cwd for key, value := range cmd.Options.Env { @@ -85,7 +86,6 @@ func (cmd *LinuxCommand) Run() error { var signalChannel chan os.Signal if len(cmd.handlers) != 0 { - command.SysProcAttr = &unix.SysProcAttr{Setsid: true} signalChannel = make(chan os.Signal, 1) signal.Notify(signalChannel, unix.SIGINT, unix.SIGTERM)