Merge pull request #14165 from eval-exec/expected-process-stopsignal

pkg/expect: send SIGTERM to target expect process instead of SIGKILL for `Stop()`
This commit is contained in:
Benjamin Wang
2022-06-28 12:38:59 +08:00
committed by GitHub

View File

@@ -42,7 +42,7 @@ type ExpectProcess struct {
count int // increment whenever new line gets added
err error
// StopSignal is the signal Stop sends to the process; defaults to SIGKILL.
// StopSignal is the signal Stop sends to the process; defaults to SIGTERM.
StopSignal os.Signal
}
@@ -58,7 +58,7 @@ func NewExpectWithEnv(name string, args []string, env []string) (ep *ExpectProce
cmd.Env = env
ep = &ExpectProcess{
cmd: cmd,
StopSignal: syscall.SIGKILL,
StopSignal: syscall.SIGTERM,
}
ep.cmd.Stderr = ep.cmd.Stdout
ep.cmd.Stdin = nil