Commit 965ae331 by Stéphane Graber

Fix incomplete destruction of unprivileged ephemeral containers

If an unprivileged ephemeral container is started as follows, lxc-start-ephemeral -o trusty -n test_ephemeral Then an empty directory remains upon exit from the container, ~/.local/share/lxc/test_ephemeral/tmpfs/delta0 (The tmpfs filesystem is successfully unmounted, but we seem to lack permission to delete the delta0 directory). This issue arose following commits 4799a1e7 and dd2271e6 . The following patch resolves the issue. It has been tested on ubuntu 14.04 with the lxc-daily ppa. Since gmail screws up the formatting of the patch via line-wrapping etc, please copy the patch from the issue-tracker rather than from this email. Signed-off by: Oleg Freedholm <overlayfs@gmail.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 6147fe2e
...@@ -221,17 +221,15 @@ LXC_NAME="%s" ...@@ -221,17 +221,15 @@ LXC_NAME="%s"
count = 0 count = 0
for entry in overlay_dirs: for entry in overlay_dirs:
tmpdir = "%s/tmpfs" % dest_path tmpdir = "%s/tmpfs" % dest_path
fd.write("mkdir -p %s\n" % (tmpdir))
if args.storage_type == "tmpfs":
fd.write("mount -n -t tmpfs -o mode=0755 none %s\n" % (tmpdir))
deltdir = "%s/delta%s" % (tmpdir, count) deltdir = "%s/delta%s" % (tmpdir, count)
workdir = "%s/work%s" % (tmpdir, count) workdir = "%s/work%s" % (tmpdir, count)
fd.write("mkdir -p %s %s\n" % (deltdir, entry[1])) fd.write("mkdir -p %s %s\n" % (deltdir, entry[1]))
if have_new_overlay: if have_new_overlay:
fd.write("mkdir -p %s\n" % workdir) fd.write("mkdir -p %s\n" % workdir)
if args.storage_type == "tmpfs":
fd.write("mount -n -t tmpfs -o mode=0755 none %s\n" % (tmpdir))
fd.write("mkdir %s\n" % deltdir)
fd.write("mkdir %s\n" % workdir)
if args.union_type == "overlayfs": if args.union_type == "overlayfs":
if have_new_overlay: if have_new_overlay:
fd.write("mount -n -t overlay" fd.write("mount -n -t overlay"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment