[lxc-devel] [PATCH] ubuntu templates: don't check for $rootfs/run/shm

Serge Hallyn serge.hallyn at ubuntu.com
Thu Aug 7 03:23:48 UTC 2014


/dev/shm must be turned from a directory into a symlink to /run/shm.
The templates do this only if they find -d $rootfs/run/shm.  Since /run
will be a tmpfs, checking for it in the rootfs is silly.  It also is
currently broken as ubuntu cloud images have an empty /run.

(this should fix https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1353734)

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 templates/lxc-ubuntu-cloud.in | 2 +-
 templates/lxc-ubuntu.in       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in
index 5de1dbd..c4eb5ca 100644
--- a/templates/lxc-ubuntu-cloud.in
+++ b/templates/lxc-ubuntu-cloud.in
@@ -122,7 +122,7 @@ EOF
     # get bind mounted to the host's /run/shm.  So try to rmdir
     # it, and in case that fails move it out of the way.
     # NOTE: This can only be removed once 12.04 goes out of support
-    if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
+    if [ ! -L $rootfs/dev/shm ] && [ -e $rootfs/dev/shm ]; then
         rmdir $rootfs/dev/shm 2>/dev/null || mv $rootfs/dev/shm $rootfs/dev/shm.bak
         ln -s /run/shm $rootfs/dev/shm
     fi
diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
index e54b558..43d4817 100644
--- a/templates/lxc-ubuntu.in
+++ b/templates/lxc-ubuntu.in
@@ -620,7 +620,7 @@ EOF
     # get bind mounted to the host's /run/shm.  So try to rmdir
     # it, and in case that fails move it out of the way.
     # NOTE: This can only be removed once 12.04 goes out of support
-    if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
+    if [ ! -L $rootfs/dev/shm ] && [ -e $rootfs/dev/shm ]; then
         rmdir $rootfs/dev/shm 2>/dev/null || mv $rootfs/dev/shm $rootfs/dev/shm.bak
         ln -s /run/shm $rootfs/dev/shm
     fi
-- 
2.1.0.rc1



More information about the lxc-devel mailing list