{"action":"closed","issue":{"url":"https://api.github.com/repos/lxc/lxc/issues/476","labels_url":"https://api.github.com/repos/lxc/lxc/issues/476/labels{/name}","comments_url":"https://api.github.com/repos/lxc/lxc/issues/476/comments","events_url":"https://api.github.com/repos/lxc/lxc/issues/476/events","html_url":"https://github.com/lxc/lxc/issues/476","id":64712361,"number":476,"title":"incomplete destruction of unprivileged ephemeral containers.","user":{"login":"overlayfs","id":8238443,"avatar_url":"https://avatars.githubusercontent.com/u/8238443?v=3","gravatar_id":"","url":"https://api.github.com/users/overlayfs","html_url":"https://github.com/overlayfs","followers_url":"https://api.github.com/users/overlayfs/followers","following_url":"https://api.github.com/users/overlayfs/following{/other_user}","gists_url":"https://api.github.com/users/overlayfs/gists{/gist_id}","starred_url":"https://api.github.com/users/overlayfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overlayfs/subscriptions","organizations_url":"https://api.github.com/users/overlayfs/orgs","repos_url":"https://api.github.com/users/overlayfs/repos","events_url":"https://api.github.com/users/overlayfs/events{/privacy}","received_events_url":"https://api.github.com/users/overlayfs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-27T07:28:56Z","updated_at":"2015-04-07T12:10:40Z","closed_at":"2015-04-07T12:10:40Z","body":"If an unprivileged ephemeral container is started as follows,\r\n\r\n    lxc-start-ephemeral -o trusty -n test_ephemeral\r\n\r\nThen an empty directory remains upon exit from the container, \r\n\r\n    ~/.local/share/lxc/test_ephemeral/tmpfs/delta0\r\n\r\n(The tmpfs filesystem is successfully unmounted, but we seem to lack permission to delete the delta0 directory).\r\n\r\nThis issue arose following commits  4799a1e7eced77ae8ef48579b81aa71127958a61 and dd2271e6bbee568064b35aa488716d478e6ea195 .\r\n\r\nThe following patch resolves the issue.  It has been tested on ubuntu 14.04 with the lxc-daily ppa.\r\n\r\n```\r\n--- /usr/bin/lxc-start-ephemeral        2015-03-18 07:09:22.000000000 +1100\r\n+++ lxc-start-ephemeral 2015-03-22 01:49:10.929867425 +1100\r\n@@ -240,17 +240,15 @@\r\n     count = 0\r\n     for entry in overlay_dirs:\r\n         tmpdir = \"%s/tmpfs\" % dest_path\r\n+        fd.write(\"mkdir -p %s\\n\" % (tmpdir))\r\n+        if args.storage_type == \"tmpfs\":\r\n+            fd.write(\"mount -n -t tmpfs -o mode=0755 none %s\\n\" % (tmpdir))\r\n         deltdir = \"%s/delta%s\" % (tmpdir, count)\r\n         workdir = \"%s/work%s\" % (tmpdir, count)\r\n         fd.write(\"mkdir -p %s %s\\n\" % (deltdir, entry[1]))\r\n         if have_new_overlay:\r\n             fd.write(\"mkdir -p %s\\n\" % workdir)\r\n \r\n-        if args.storage_type == \"tmpfs\":\r\n-            fd.write(\"mount -n -t tmpfs -o mode=0755 none %s\\n\" % (tmpdir))\r\n-            fd.write(\"mkdir %s\\n\" % deltdir)\r\n-            fd.write(\"mkdir %s\\n\" % workdir)\r\n-\r\n         fd.write(\"getfacl -a %s | setfacl --set-file=- %s || true\\n\" %\r\n                  (entry[0], deltdir))\r\n         fd.write(\"getfacl -a %s | setfacl --set-file=- %s || true\\n\" %\r\n```\r\n\r\nSigned-off by: Oleg Freedholm <overlayfs at gmail.com>"}}