diff --git a/local/runner.go b/local/runner.go index b67ee30..5e9a313 100644 --- a/local/runner.go +++ b/local/runner.go @@ -277,7 +277,7 @@ func (r *Runner) buildCmd() (*exec.Cmd, error) { cmd.Env = os.Environ() cmd.Dir = r.pidFile.Dir - if err := buildCmd(cmd); err != nil { + if err := buildCmd(cmd, r.mode == RunnerModeOnce); err != nil { return nil, err } diff --git a/local/runner_posix.go b/local/runner_posix.go index a19321c..71cb7ab 100644 --- a/local/runner_posix.go +++ b/local/runner_posix.go @@ -8,11 +8,12 @@ import ( "syscall" ) -func buildCmd(cmd *exec.Cmd) error { +func buildCmd(cmd *exec.Cmd, foreground bool) error { cmd.SysProcAttr = &syscall.SysProcAttr{ // isolate each command in a new process group that we can cleanly send // signal to when we want to stop it - Setpgid: true, + Setpgid: true, + Foreground: foreground, } return nil diff --git a/local/runner_windows.go b/local/runner_windows.go index 46fe443..4b0ec0b 100644 --- a/local/runner_windows.go +++ b/local/runner_windows.go @@ -2,6 +2,6 @@ package local import "os/exec" -func buildCmd(*exec.Cmd) error { +func buildCmd(*exec.Cmd, bool) error { return nil }