From a693fb5cd6a34c808710444bdf7859ce988600b5 Mon Sep 17 00:00:00 2001 From: Shane C Date: Thu, 11 Jul 2024 16:45:10 -0400 Subject: [PATCH] fix sysprocattr --- linux/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)