fix sysprocattr

This commit is contained in:
Shane C 2024-07-11 16:45:10 -04:00
parent 2b190eccb7
commit a693fb5cd6
Signed by: shane
GPG key ID: E46B5FEA35B22FF9

View file

@ -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)