Files
kopia/tests/tools/kopiarunner/setpdeath_linux.go
Julio López 3795ffc6f9 robustness: minor cleanups (#726)
Remove unnecessary intermediate variables.
Send SIGTERM instead of SIGKILL to terminate child kopia server process.
Set Pdeathsig on Linux for child kopia server process.
Trivial: reduce scope of hostFioDataPathStr variable.
Trivial: rename local variable.
Trivial: Use log.Fatalln instead of log + exit(1).
Improve error message in robustness test to tell apart failure cause.
2020-12-16 12:49:54 -08:00

21 lines
255 B
Go

package kopiarunner
import (
"os/exec"
"syscall"
)
func setpdeath(c *exec.Cmd) *exec.Cmd {
if c == nil {
return nil
}
if c.SysProcAttr == nil {
c.SysProcAttr = &syscall.SysProcAttr{}
}
c.SysProcAttr.Pdeathsig = syscall.SIGTERM
return c
}