]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
ubuntu: Actually attempt to remove /dev/shm
authorStéphane Graber <stgraber@ubuntu.com>
Sat, 30 Nov 2013 00:22:53 +0000 (19:22 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 2 Dec 2013 17:36:57 +0000 (12:36 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-ubuntu-cloud.in
templates/lxc-ubuntu.in

index 3042d89a78f01b57b6cdac88e10af252696102a9..e97c7e3a3a07228bd537f1b33ae711aaecb5718b 100644 (file)
@@ -139,8 +139,9 @@ EOF
     # I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
     # 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
-        mv $rootfs/dev/shm $rootfs/dev/shm.bak
+        rmdir $rootfs/dev/shm 2>/dev/null || mv $rootfs/dev/shm $rootfs/dev/shm.bak
         ln -s /run/shm $rootfs/dev/shm
     fi
 
index 4e6a54f25b6c70c5cf71dd1ce48ad6f9553f25f8..8ed9be7cd0da851b85ca1d59c93726e31ed92d39 100644 (file)
@@ -541,8 +541,9 @@ EOF
     # I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
     # 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
-        mv $rootfs/dev/shm $rootfs/dev/shm.bak
+        rmdir $rootfs/dev/shm 2>/dev/null || mv $rootfs/dev/shm $rootfs/dev/shm.bak
         ln -s /run/shm $rootfs/dev/shm
     fi