diff --git a/service/driver.go b/service/driver.go index 272fc5ff..096fd557 100644 --- a/service/driver.go +++ b/service/driver.go @@ -88,7 +88,7 @@ func (d *Driver) stopProcess(cmd *exec.Cmd) { log.Printf("[%d] [FAILED_TO_TERMINATE_PROCESS] [%d] [%v]", d.RequestId, cmd.Process.Pid, err) return } - if d.CaptureDriverLogs && d.LogOutputDir != "" { + if !d.CaptureDriverLogs && d.LogOutputDir != "" { cmd.Stdout.(*os.File).Close() } log.Printf("[%d] [TERMINATED_PROCESS] [%d] [%.2fs]", d.RequestId, cmd.Process.Pid, util.SecondsSince(s)) diff --git a/service/driver_windows.go b/service/driver_windows.go index 475bf4c9..cff64adb 100644 --- a/service/driver_windows.go +++ b/service/driver_windows.go @@ -7,5 +7,7 @@ import ( ) func stopProc(cmd *exec.Cmd) error { - return cmd.Process.Kill() + error := cmd.Process.Kill() + cmd.Wait() + return error }