diff -u lxc-0.6.5/debian/control lxc-0.6.5/debian/control --- lxc-0.6.5/debian/control +++ lxc-0.6.5/debian/control @@ -2,7 +2,8 @@ Section: admin Priority: optional Maintainer: Guido Trotter -Build-Depends: cdbs, debhelper (>= 7), autotools-dev, libcap-dev, linux-libc-dev +Build-Depends: cdbs, debhelper (>= 7), autotools-dev, libcap-dev, + linux-libc-dev, quilt (>= 0.40), dpatch, libc6-dev, linux-libc-dev Standards-Version: 3.8.3 Homepage: http://lxc.sourceforge.net/ Vcs-Git: git://git.debian.org/git/collab-maint/lxc.git diff -u lxc-0.6.5/debian/changelog lxc-0.6.5/debian/changelog --- lxc-0.6.5/debian/changelog +++ lxc-0.6.5/debian/changelog @@ -1,3 +1,11 @@ +lxc (0.6.5-1ubuntu1) lucid; urgency=low + + * Incorporate force-umount-rootfs.patch (patch from Daniel, copied + from aljex's opensuse package) to fix bug when /var is on a + separate partition. (LP: #566827) + + -- Serge Hallyn Wed, 25 Aug 2010 08:51:45 -0500 + lxc (0.6.5-1) unstable; urgency=low * New upstream version (closes: #566771) diff -u lxc-0.6.5/debian/rules lxc-0.6.5/debian/rules --- lxc-0.6.5/debian/rules +++ lxc-0.6.5/debian/rules @@ -2,8 +2,7 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk -# We don't have patches, for now... -#include /usr/share/cdbs/1/rules/dpatch.mk +include /usr/share/cdbs/1/rules/dpatch.mk # Install liblxc in out private area, for now, until it's stable. LIBDIR="\$${prefix}/lib/lxc" only in patch2: unchanged: --- lxc-0.6.5.orig/debian/patches/00list +++ lxc-0.6.5/debian/patches/00list @@ -0,0 +1 @@ +use-mnt-detach.patch.dpatch only in patch2: unchanged: --- lxc-0.6.5.orig/debian/patches/use-mnt-detach.patch.dpatch +++ lxc-0.6.5/debian/patches/use-mnt-detach.patch.dpatch @@ -0,0 +1,81 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## use-mnt-detach.patch.dpatch by Serge Hallyn +## Author: Daniel Lezcano +## Bug: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/566827 +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lxc-0.6.5~/src/lxc/conf.c lxc-0.6.5/src/lxc/conf.c +--- lxc-0.6.5~/src/lxc/conf.c 2010-08-27 09:01:36.000000000 -0500 ++++ lxc-0.6.5/src/lxc/conf.c 2010-08-27 09:17:59.364550998 -0500 +@@ -67,6 +67,10 @@ + #define MS_REC 16384 + #endif + ++#ifndef MNT_DETACH ++#define MNT_DETACH 2 ++#endif ++ + #ifndef CAP_SETFCAP + #define CAP_SETFCAP 31 + #endif +@@ -532,6 +536,7 @@ + + lxc_list_for_each(iterator, &mountlist) { + ++ /* umount normally */ + if (!umount(iterator->elem)) { + DEBUG("umounted '%s'", (char *)iterator->elem); + lxc_list_del(iterator); +@@ -544,24 +549,38 @@ + } while (still_mounted > 0 && still_mounted != last_still_mounted); + + +- lxc_list_for_each(iterator, &mountlist) ++ lxc_list_for_each(iterator, &mountlist) { ++ ++ /* let's try a lazy umount */ ++ if (!umount2(iterator->elem, MNT_DETACH)) { ++ INFO("lazy unmount of '%s'", (char *)iterator->elem); ++ continue; ++ } ++ ++ /* be more brutal (nfs) */ ++ if (!umount2(iterator->elem, MNT_FORCE)) { ++ INFO("forced unmount of '%s'", (char *)iterator->elem); ++ continue; ++ } ++ + WARN("failed to unmount '%s'", (char *)iterator->elem); ++ } + +- /* umount old root fs */ +- if (umount(pivotdir)) { ++ /* umount old root fs; if some other mount points are still ++ * there, we won't be able to umount it, so we have to do ++ * that in a lazy way otherwise the container will always ++ * fail to start ++ */ ++ if (umount2(pivotdir, MNT_DETACH)) { + SYSERROR("could not unmount old rootfs"); + return -1; + } + DEBUG("umounted '%s'", pivotdir); + +- /* remove temporary mount point */ +- if (pivotdir_is_temp) { +- if (rmdir(pivotdir)) { +- SYSERROR("can't remove temporary mountpoint"); +- return -1; +- } +- +- } ++ /* remove temporary mount point, we don't consider the removing ++ * as fatal */ ++ if (pivotdir_is_temp && rmdir(pivotdir)) ++ WARN("can't remove temporary mountpoint: %m"); + + INFO("pivoted to '%s'", rootfs); + return 0;