mirror of
https://github.com/containers/podman.git
synced 2025-10-17 11:14:40 +08:00
rootless: don't bind mount /sys/fs/cgroup/systemd in systemd mode
it is not writeable by non-root users so there is no point in having access to it from a container. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -360,6 +360,9 @@ func (c *Container) setupSystemd(mounts []spec.Mount, g generate.Generator) erro
|
||||
g.AddMount(tmpfsMnt)
|
||||
}
|
||||
|
||||
// rootless containers have no write access to /sys/fs/cgroup, so don't
|
||||
// add any mount into the container.
|
||||
if !rootless.IsRootless() {
|
||||
cgroupPath, err := c.CGroupPath()
|
||||
if err != nil {
|
||||
return err
|
||||
@ -373,6 +376,7 @@ func (c *Container) setupSystemd(mounts []spec.Mount, g generate.Generator) erro
|
||||
Options: []string{"bind", "private"},
|
||||
}
|
||||
g.AddMount(systemdMnt)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user