← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~lamont/launchpad/lp-buildd-80 into lp:launchpad

 

LaMont Jones has proposed merging lp:~lamont/launchpad/lp-buildd-80 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lamont/launchpad/lp-buildd-80/+merge/76007

As-released lp-buildd 80
-- 
https://code.launchpad.net/~lamont/launchpad/lp-buildd-80/+merge/76007
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lamont/launchpad/lp-buildd-80 into lp:launchpad.
=== modified file 'lib/canonical/buildd/debian/changelog'
--- lib/canonical/buildd/debian/changelog	2011-08-19 13:32:16 +0000
+++ lib/canonical/buildd/debian/changelog	2011-09-19 11:50:27 +0000
@@ -1,3 +1,9 @@
+launchpad-buildd (80) hardy-cat; urgency=low
+
+  * binfmt-support demonstrated umount ordering issues for us.  LP: #851934
+
+ -- LaMont Jones <lamont@xxxxxxxxxxxxx>  Mon, 19 Sep 2011 04:56:58 -0600
+
 launchpad-buildd (79) hardy-cat; urgency=low
 
   * Fix sudoers.d/buildd permissions

=== modified file 'lib/canonical/buildd/umount-chroot'
--- lib/canonical/buildd/umount-chroot	2010-12-21 17:52:32 +0000
+++ lib/canonical/buildd/umount-chroot	2011-09-19 11:50:27 +0000
@@ -14,6 +14,7 @@
 GREP=/bin/grep
 CUT=/usr/bin/cut
 XARGS=/usr/bin/xargs
+SORT=/usr/bin/sort
 
 set -e
 
@@ -21,10 +22,19 @@
 
 echo "Unmounting chroot for build $BUILDID..."
 
-#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/proc"
-#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/dev/pts"
-#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/home/buildd/.ccache"
-#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/var/cache/apt/archives"
-#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/dev/shm"
-$GREP "$HOME/build-$BUILDID/chroot-autobuild" /proc/mounts | \
-      $CUT -d\  -f2 | $XARGS -r -n 1 $SUDO umount
+# binfmt-support adds a mount under /proc, which means that our first
+# pass at umounting fails unless we reverse the list.  Leave the while
+# loop in just to handle pathological cases, too.
+COUNT=0
+while $GREP "$HOME/build-$BUILDID/chroot-autobuild" /proc/mounts; do 
+    COUNT=$(($COUNT+1))
+    if [ $COUNT -ge 20 ]; then
+    	echo "failed to umount $HOME/build-$BUILDID/chroot-autobuild"
+	if [ -x /usr/bin/lsof ]; then
+	    /usr/bin/lsof "$HOME/build-$BUILDID/chroot-autobuild"
+	fi
+	exit 1
+    fi
+    $GREP "$HOME/build-$BUILDID/chroot-autobuild" /proc/mounts | \
+	  $CUT -d\  -f2 | LANG=C $SORT -r | $XARGS -r -n 1 $SUDO umount || sleep 1
+done