refactor
This commit is contained in:
parent
f009c43878
commit
8664c3df37
|
@ -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
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// Windows environment variables.
|
||||
|
||||
package sys
|
||||
|
||||
import (
|
||||
|
|
|
@ -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()
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package engine
|
||||
|
||||
import "os/exec"
|
||||
|
||||
func startCmd(c *exec.Cmd) error {
|
||||
return c.Start()
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue