[Fai-commit] r5996 - in branches/stable/3.4: debian lib

Michael Prokop mika at alioth.debian.org
Tue Aug 17 12:55:08 UTC 2010


Author: mika
Date: 2010-08-17 12:55:08 +0000 (Tue, 17 Aug 2010)
New Revision: 5996

Modified:
   branches/stable/3.4/debian/changelog
   branches/stable/3.4/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


Signed-off-by: Michael Prokop <mika at grml.org>

Modified: branches/stable/3.4/debian/changelog
===================================================================
--- branches/stable/3.4/debian/changelog	2010-08-17 12:55:02 UTC (rev 5995)
+++ branches/stable/3.4/debian/changelog	2010-08-17 12:55:08 UTC (rev 5996)
@@ -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: branches/stable/3.4/lib/subroutines
===================================================================
--- branches/stable/3.4/lib/subroutines	2010-08-17 12:55:02 UTC (rev 5995)
+++ branches/stable/3.4/lib/subroutines	2010-08-17 12:55:08 UTC (rev 5996)
@@ -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