[3.5]backport: pkg/expect: send SIGTERM to target expect process instead of SIGKILL

Signed-off-by: Eval EXEC <execvy@gmail.com>
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
This commit is contained in:
Eval EXEC 2022-06-26 16:20:17 +08:00 committed by ArkaSaha30
parent 3afe949552
commit 4f33d5bcaf
No known key found for this signature in database
GPG Key ID: C5FF37943E5BC363

View File

@ -42,7 +42,7 @@ type ExpectProcess struct {
count int // increment whenever new line gets added count int // increment whenever new line gets added
err error 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 StopSignal os.Signal
} }
@ -58,7 +58,7 @@ func NewExpectWithEnv(name string, args []string, env []string) (ep *ExpectProce
cmd.Env = env cmd.Env = env
ep = &ExpectProcess{ ep = &ExpectProcess{
cmd: cmd, cmd: cmd,
StopSignal: syscall.SIGKILL, StopSignal: syscall.SIGTERM,
} }
ep.cmd.Stderr = ep.cmd.Stdout ep.cmd.Stderr = ep.cmd.Stdout
ep.cmd.Stdin = nil ep.cmd.Stdin = nil