Add an option to prevent putting the shim in a new mount namespace

This is needed for users on kernel older than 3.18 so they can avoid EBUSY
errors when trying to unlink, rename or remove a mountpoint that is present in
a shim namespace.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-10-03 09:18:54 -07:00
parent 6b9aafdab1
commit 26d4c2c217
7 changed files with 39 additions and 15 deletions

View File

@@ -7,8 +7,10 @@ import (
"syscall"
)
var atter = syscall.SysProcAttr{
Setpgid: true,
func getSysProcAttr(nonewns bool) *syscall.SysProcAttr {
return &syscall.SysProcAttr{
Setpgid: true,
}
}
func setCgroup(cgroupPath string, cmd *exec.Cmd) error {