Merge lp:~gary/ubuntu/precise/lxc/bug-951150-2 into lp:ubuntu/precise/lxc

Proposed by Gary Poster
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~gary/ubuntu/precise/lxc/bug-951150-2
Merge into: lp:ubuntu/precise/lxc
Diff against target: 39 lines (+7/-1)
1 file modified
debian/local/lxc-start-ephemeral (+7/-1)
To merge this branch: bzr merge lp:~gary/ubuntu/precise/lxc/bug-951150-2
Reviewer Review Type Date Requested Status
Serge Hallyn Approve
Ubuntu branches Pending
Review via email: mp+97077@code.launchpad.net

Description of the change

It turns out that using an overlayfs as the upperdir of an overlayfs does not work. Files cannot be removed. Perhaps overlayfs does not support xattrs, even though it requires them?

Therefore, this branch adjusts my changes from lp:~gary/ubuntu/precise/lxc/bug-951150 to use a tempfs for the upperdir. Removing files now works.

Thank you

To post a comment you must log in.
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks, merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/local/lxc-start-ephemeral'
--- debian/local/lxc-start-ephemeral 2012-03-12 09:51:59 +0000
+++ debian/local/lxc-start-ephemeral 2012-03-12 18:16:37 +0000
@@ -40,6 +40,7 @@
40 sudo lxc-stop -n $LXC_NAME40 sudo lxc-stop -n $LXC_NAME
41 fi41 fi
42 if [ $LXC_MOUNTED -eq 1 ]; then42 if [ $LXC_MOUNTED -eq 1 ]; then
43 sudo umount $EPHEMERAL_BIND_DIR
43 sudo umount $LXC_DIR44 sudo umount $LXC_DIR
44 sudo umount $OVERLAY_DIR45 sudo umount $OVERLAY_DIR
45 sudo rmdir $LXC_DIR46 sudo rmdir $LXC_DIR
@@ -121,6 +122,9 @@
121 LXC_DIR=`sudo mktemp -d --tmpdir=/var/lib/lxc $LXC_BASE-temp-XXXXXXX`122 LXC_DIR=`sudo mktemp -d --tmpdir=/var/lib/lxc $LXC_BASE-temp-XXXXXXX`
122 LXC_NAME=`basename $LXC_DIR`123 LXC_NAME=`basename $LXC_DIR`
123 sudo mount -t overlayfs -oupperdir=$OVERLAY_DIR,lowerdir=/var/lib/lxc/$LXC_BASE none $LXC_DIR124 sudo mount -t overlayfs -oupperdir=$OVERLAY_DIR,lowerdir=/var/lib/lxc/$LXC_BASE none $LXC_DIR
125 EPHEMERAL_BIND_DIR=$LXC_DIR/ephemeralbind
126 sudo mkdir $EPHEMERAL_BIND_DIR
127 sudo mount -t tmpfs none $EPHEMERAL_BIND_DIR
124 LXC_MOUNTED=1128 LXC_MOUNTED=1
125129
126 # Update the ephemeral lxc's configuration to reflect the new container name.130 # Update the ephemeral lxc's configuration to reflect the new container name.
@@ -140,7 +144,7 @@
140 if [ `echo -n $line | awk '{print $4}'` == "bind" ]; then144 if [ `echo -n $line | awk '{print $4}'` == "bind" ]; then
141 # ...we should rewrite it as an overlay.145 # ...we should rewrite it as an overlay.
142 source=`echo -n $line | awk '{print $1}'`146 source=`echo -n $line | awk '{print $1}'`
143 upperdir=$LXC_DIR/ephemeralbind$source147 upperdir=$EPHEMERAL_BIND_DIR$source
144 sudo mkdir -p $upperdir148 sudo mkdir -p $upperdir
145 sudo chown `sudo stat -c '%U.%G' $source` $upperdir149 sudo chown `sudo stat -c '%U.%G' $source` $upperdir
146 echo "none $path overlayfs upperdir=$upperdir,lowerdir=$source 0 0";150 echo "none $path overlayfs upperdir=$upperdir,lowerdir=$source 0 0";
@@ -237,6 +241,8 @@
237 echo "Stopping lxc" >&2241 echo "Stopping lxc" >&2
238 sudo lxc-stop -n $LXC_NAME242 sudo lxc-stop -n $LXC_NAME
239 sleep 2243 sleep 2
244 # echo "umounting ephemeral_bind_dir $EPHEMERAL_BIND_DIR" >&2
245 sudo umount $EPHEMERAL_BIND_DIR
240 # echo "umounting lxc_dir $LXC_DIR" >&2246 # echo "umounting lxc_dir $LXC_DIR" >&2
241 sudo umount $LXC_DIR247 sudo umount $LXC_DIR
242 # echo "umounting overlay" >&2248 # echo "umounting overlay" >&2

Subscribers

People subscribed via source and target branches

to all changes: