[Fai-commit] r5850 - in trunk: debian lib

Michael Prokop mika at alioth.debian.org
Fri Jul 9 11:16:41 UTC 2010


Author: mika
Date: 2010-07-09 11:16:40 +0000 (Fri, 09 Jul 2010)
New Revision: 5850

Modified:
   trunk/debian/changelog
   trunk/lib/subroutines
Log:
subroutines: /proc + /sys might be empty because they were unmounted
inside $FAI_ROOT but are still registered in /etc/mtab outside of
$FAI_ROOT, so let's get rid of them outside the chroot as well iff
they are present

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2010-07-08 22:22:00 UTC (rev 5849)
+++ trunk/debian/changelog	2010-07-09 11:16:40 UTC (rev 5850)
@@ -44,6 +44,10 @@
     systems using the -s option
   * install_packages.8: fix wording of description of -N option
   * subroutines, fai: display date of execution (fai_rundate) on startup
+  * subroutines: /proc + /sys might be empty because they were unmounted
+    inside $FAI_ROOT but are still registered in /etc/mtab outside of
+    $FAI_ROOT, so let's get rid of them outside the chroot as well iff
+    they are present
 
  -- Thomas Lange <lange at debian.org>  Fri, 25 Jun 2010 14:29:10 +0200
 

Modified: trunk/lib/subroutines
===================================================================
--- trunk/lib/subroutines	2010-07-08 22:22:00 UTC (rev 5849)
+++ trunk/lib/subroutines	2010-07-09 11:16:40 UTC (rev 5850)
@@ -526,7 +526,17 @@
     clean_exit() {
 	rm -f $stamp
 	[ -z "$FAI_ROOT" ] && return
-	[ -d $FAI_ROOT/proc/self ] && umount $FAI_ROOT/proc $FAI_ROOT/sys
+	[ -d $FAI_ROOT/proc/self ] && umount $FAI_ROOT/proc
+	[ -d $FAI_ROOT/sys/class ] && umount $FAI_ROOT/sys
+	# /proc + /sys might be empty because they were unmounted inside
+	# $FAI_ROOT but are still registered in /etc/mtab outside $FAI_ROOT,
+	# so let's get rid of them outside the chroot as well
+	if grep -q "${FAI_ROOT}/sys " /etc/mtab ; then
+	   umount $FAI_ROOT/sys 2>/dev/null || true
+	fi
+	if grep -q "${FAI_ROOT}/proc " /etc/mtab ; then
+	   umount $FAI_ROOT/proc 2>/dev/null || true
+	fi
 	umount $FAI_ROOT/dev/pts 2>/dev/null || true
 	# sometimes umount $FAI_ROOT/dev fails, because a process is
 	# still running in the background and accesses /dev 




More information about the Fai-commit mailing list