~serge-hallyn/ubuntu/quantal/lxc/lxc-fixapi

« back to all changes in this revision

Viewing changes to debian/patches/0094-fix-dev-shm-check

  • Committer: Stéphane Graber
  • Date: 2012-07-26 17:28:51 UTC
  • Revision ID: stgraber@ubuntu.com-20120726172851-hx2wiykjv9t1ymbn
Apply same fix to lxc-ubuntu-cloud

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
         ln -s /run/shm $rootfs/dev/shm
22
22
     fi
23
23
 }
 
24
Index: lxc/templates/lxc-ubuntu-cloud.in
 
25
===================================================================
 
26
--- lxc.orig/templates/lxc-ubuntu-cloud.in      2012-07-26 13:26:28.134423000 -0400
 
27
+++ lxc/templates/lxc-ubuntu-cloud.in   2012-07-26 13:27:40.772127204 -0400
 
28
@@ -96,13 +96,12 @@
 
29
 sysfs           sys          sysfs defaults  0 0
 
30
 EOF
 
31
 
 
32
-    # rmdir /dev/shm in precise and quantal containers.
 
33
+    # rmdir /dev/shm for containers that have /run/shm
 
34
     # I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
 
35
     # get bind mounted to the host's /run/shm.  So try to rmdir
 
36
     # it, and in case that fails move it out of the way.
 
37
-    if [ $release = "precise" ] || [ $release = "quantal" ]; then
 
38
-        [ -d "$rootfs/dev/shm" ] && rmdir $rootfs/dev/shm
 
39
-        [ -e "$rootfs/dev/shm" ] && mv $rootfs/dev/shm $rootfs/dev/shm.bak
 
40
+    if [ ! -L $rootfs/dev/shm ] && [ -d $rootfs/run/shm ] && [ -e $rootfs/dev/shm ]; then
 
41
+        mv $rootfs/dev/shm $rootfs/dev/shm.bak
 
42
         ln -s /run/shm $rootfs/dev/shm
 
43
     fi
 
44