[PC-BSD Commits] r17821 - pcbsd/current/src-sh/warden/scripts/backend

svn at pcbsd.org svn at pcbsd.org
Thu Jul 19 12:25:17 PDT 2012


Author: kris
Date: 2012-07-19 19:25:17 +0000 (Thu, 19 Jul 2012)
New Revision: 17821

Modified:
   pcbsd/current/src-sh/warden/scripts/backend/checkstatus.sh
   pcbsd/current/src-sh/warden/scripts/backend/deletejail.sh
Log:

When we check for leftover mounts, make sure we look for non nullfs mounts

Also fix debian 6 linux setup



Modified: pcbsd/current/src-sh/warden/scripts/backend/checkstatus.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/checkstatus.sh	2012-07-19 19:20:01 UTC (rev 17820)
+++ pcbsd/current/src-sh/warden/scripts/backend/checkstatus.sh	2012-07-19 19:25:17 UTC (rev 17821)
@@ -34,7 +34,7 @@
 
 # Check if anything is still mounted in this jail
 hasmount="0"
-for mountpoint in $(mount | grep -w '${JDIR}/${IP}/' | cut -d" " -f3); do
+for mountpoint in $(mount | grep -e '${JDIR}/${IP}/' | cut -d" " -f3); do
   hasmount="1"
 done
 

Modified: pcbsd/current/src-sh/warden/scripts/backend/deletejail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/deletejail.sh	2012-07-19 19:20:01 UTC (rev 17820)
+++ pcbsd/current/src-sh/warden/scripts/backend/deletejail.sh	2012-07-19 19:25:17 UTC (rev 17821)
@@ -40,6 +40,13 @@
   ${PROGDIR}/scripts/backend/stopjail.sh "${IP}"
 fi
 
+# Confirm jail was shutdown and no mounts are left
+${PROGDIR}/scripts/backend/checkstatus.sh "${IP}"
+if [ "$?" = "0" ] ; then
+   echo "ERROR: Jail is still running, or has active mount-points.. Please stop manually."
+   exit 5
+fi
+
 echo -e "Deleting Jail...\c"
 isDirZFS "${JDIR}/${IP}" "1"
 if [ $? -eq 0 ] ; then



More information about the Commits mailing list