[Fai-commit] r4750 - trunk/bin

lange at alioth.debian.org lange at alioth.debian.org
Thu Nov 15 17:17:37 UTC 2007


Author: lange
Date: 2007-11-15 17:17:36 +0000 (Thu, 15 Nov 2007)
New Revision: 4750

Modified:
   trunk/bin/make-fai-nfsroot
Log:
try to umount /proc inside the nfsroot before removing an old nfsroot,
abort if this fails


Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot	2007-11-15 16:07:38 UTC (rev 4749)
+++ trunk/bin/make-fai-nfsroot	2007-11-15 17:17:36 UTC (rev 4750)
@@ -386,7 +386,7 @@
        LC_ALL=C $ROOTCMD dpkg-divert --rename --remove /sbin/discover-modprobe
     cd /
     [ -d $NFSROOT/proc/self ] && umount $NFSROOT/proc 
-    [ -d $NFSROOT/proc/self ] && umount $NFSROOT/dev/pts
+    [ -d $NFSROOT/proc/self ] && die "/proc still mounted inside the nfsroot."
     if [ "$FAI_DEBMIRROR" ]; then
         test -d $NFSROOT/$MNTPOINT && umount $NFSROOT/$MNTPOINT || true
     fi
@@ -518,10 +518,12 @@
 fi
 
 # Kill the directory if not in recover mode
-if [ -d $NFSROOT/$FAI -a ! "$recover" ]
+if [ -d $NFSROOT/proc -a ! "$recover" ]
 then
     echo $NFSROOT already exists. Removing $NFSROOT
     umount $NFSROOT/dev/pts 1>/dev/null 2>&1 || true
+    [ -L $NFSROOT/proc/self ] && umount $NFSROOT/proc || true
+    [ -L $NFSROOT/proc/self ] && die "/proc is still mounted inside the nfsroot."
     rm -rf $oldnfsroot/.??* $oldnfsroot/*
     # also remove files $NFSROOT/.? but not . and ..
     find $oldnfsroot -xdev -maxdepth 1 ! -type d | xargs -r rm -f




More information about the Fai-commit mailing list