Skip to content

mountSysfs needs to mount /sys/fs/selinux ? #94

@AkihiroSuda

Description

@AkihiroSuda

// mountSysfs is needed for mounting /sys/class/net
// when netns is unshared.
func mountSysfs() error {
tmp, err := ioutil.TempDir("/tmp", "rksys")
if err != nil {
return errors.Wrap(err, "creating a directory under /tmp")
}
defer os.RemoveAll(tmp)
cmds := [][]string{
{"mount", "--rbind", "/sys/fs/cgroup", tmp},
{"mount", "-t", "sysfs", "none", "/sys"},
{"mount", "-n", "--move", tmp, "/sys/fs/cgroup"},
}
if err := common.Execs(os.Stderr, os.Environ(), cmds); err != nil {
return errors.Wrapf(err, "executing %v", cmds)
}
return nil
}

According to https://github.com/podenv/silverkube/blob/eb3fac03bdbcc7a2e9a25c255a8146287269a2df/silverkube.py#L132 , it seems the function needs to mount /sys/fs/selinux as well as /sys/fs/cgroup ?

cc @TristanCacqueray

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions