mirror of
https://github.com/containers/skopeo.git
synced 2025-09-16 15:00:14 +00:00
tests: Add new "procutils" that exposes PDEATHSIG
To fix compilation on MacOS. I think actually we want to use this pervasively in our tests on Linux; it doesn't really matter when run inside a transient container, but `PDEATHSIG` is useful for persistent containers (e.g.) toolbox and when running outside of a pid namespace, e.g. on a host system shell directly or in systemd. Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
14
integration/procutils_linux.go
Normal file
14
integration/procutils_linux.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// cmdLifecyleToParentIfPossible is a thin wrapper around prctl(PR_SET_PDEATHSIG)
|
||||
// on Linux.
|
||||
func cmdLifecycleToParentIfPossible(c *exec.Cmd) {
|
||||
c.SysProcAttr = &syscall.SysProcAttr{
|
||||
Pdeathsig: syscall.SIGTERM,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user