This commit is contained in:
Ulric Qin 2022-02-18 16:29:49 +08:00
parent f009c43878
commit 8664c3df37
5 changed files with 24 additions and 6 deletions

View File

@ -1,6 +1,5 @@
// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris plan9
// Unix environment variables.
//go:build !windows
// +build !windows
package sys

View File

@ -1,5 +1,3 @@
// Windows environment variables.
package sys
import (

View File

@ -0,0 +1,14 @@
//go:build !windows
// +build !windows
package engine
import (
"os/exec"
"syscall"
)
func startCmd(c *exec.Cmd) error {
c.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
return c.Start()
}

View File

@ -0,0 +1,7 @@
package engine
import "os/exec"
func startCmd(c *exec.Cmd) error {
return c.Start()
}

View File

@ -242,7 +242,7 @@ func callScript(stdinBytes []byte) {
cmd.Stdout = &buf
cmd.Stderr = &buf
err := cmd.Start()
err := startCmd(cmd)
if err != nil {
logger.Errorf("event_notify: run cmd err: %v", err)
return