summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-30 09:06:06 -0800
committerGitHub <noreply@github.com>2018-11-30 09:06:06 -0800
commit36364b18a97c6dc967c2cd36f34a672b9d102f0e (patch)
tree33aad6cab8eb6867c16759ffe8b4efefcc93dafc /libpod/container_internal.go
parent96c4dd73029030bb07e10f0b5e562e8d88f81742 (diff)
parenta5be3ffa4d1502072fd18ee280cc062b71fbe574 (diff)
downloadpodman-36364b18a97c6dc967c2cd36f34a672b9d102f0e.tar.gz
podman-36364b18a97c6dc967c2cd36f34a672b9d102f0e.tar.bz2
podman-36364b18a97c6dc967c2cd36f34a672b9d102f0e.zip
Merge pull request #1777 from rhatdan/shm
/dev/shm should be mounted even in rootless mode.
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go26
1 files changed, 10 insertions, 16 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index b616e0a07..24ddb6655 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -821,28 +821,22 @@ func (c *Container) mountStorage() (string, error) {
return c.state.Mountpoint, nil
}
- if !rootless.IsRootless() {
- // TODO: generalize this mount code so it will mount every mount in ctr.config.Mounts
- mounted, err := mount.Mounted(c.config.ShmDir)
- if err != nil {
- return "", errors.Wrapf(err, "unable to determine if %q is mounted", c.config.ShmDir)
- }
+ mounted, err := mount.Mounted(c.config.ShmDir)
+ if err != nil {
+ return "", errors.Wrapf(err, "unable to determine if %q is mounted", c.config.ShmDir)
+ }
+ if !mounted {
+ shmOptions := fmt.Sprintf("mode=1777,size=%d", c.config.ShmSize)
+ if err := c.mountSHM(shmOptions); err != nil {
+ return "", err
+ }
if err := os.Chown(c.config.ShmDir, c.RootUID(), c.RootGID()); err != nil {
return "", errors.Wrapf(err, "failed to chown %s", c.config.ShmDir)
}
-
- if !mounted {
- shmOptions := fmt.Sprintf("mode=1777,size=%d", c.config.ShmSize)
- if err := c.mountSHM(shmOptions); err != nil {
- return "", err
- }
- if err := os.Chown(c.config.ShmDir, c.RootUID(), c.RootGID()); err != nil {
- return "", errors.Wrapf(err, "failed to chown %s", c.config.ShmDir)
- }
- }
}
+ // TODO: generalize this mount code so it will mount every mount in ctr.config.Mounts
mountPoint := c.config.Rootfs
if mountPoint == "" {
mountPoint, err = c.mount()