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:
@@ -10,9 +10,14 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var atter = syscall.SysProcAttr{
|
||||
Cloneflags: syscall.CLONE_NEWNS,
|
||||
Setpgid: true,
|
||||
func getSysProcAttr(nonewns bool) *syscall.SysProcAttr {
|
||||
attr := syscall.SysProcAttr{
|
||||
Setpgid: true,
|
||||
}
|
||||
if !nonewns {
|
||||
attr.Cloneflags = syscall.CLONE_NEWNS
|
||||
}
|
||||
return &attr
|
||||
}
|
||||
|
||||
func setCgroup(cgroupPath string, cmd *exec.Cmd) error {
|
||||
|
||||
Reference in New Issue
Block a user