Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix a usage quirk with warden. Don't report jail as running just

because a mount-point is still left.

We will now check for that condition only before trying to delete a
jail
  • Loading branch information...
commit 6d06bd191fe140361b5d4e3c396d1da5f4c4f3bf 1 parent 65f39d9
@kmoore134 kmoore134 authored
View
14 src-sh/warden/scripts/backend/checkstatus.sh
@@ -34,16 +34,6 @@ fi
# End of error checking, now see if the jail is active
#####################################################################
-# Check if anything is still mounted in this jail
-hasmount="0"
-for mountpoint in $(mount | grep -e "${JAILDIR}/" | cut -d" " -f3); do
- hasmount="1"
-done
-
# Check if the jail is active
-jls | grep "${JAILDIR}$" >/dev/null 2>/dev/null
-if [ "$?" = "0" -o "$hasmount" = "1" ]; then
- exit 0
-else
- exit 1
-fi
+jls | grep -q "${JAILDIR}$"
+exit $?
View
12 src-sh/warden/scripts/backend/deletejail.sh
@@ -45,7 +45,17 @@ fi
# Confirm jail was shutdown and no mounts are left
${PROGDIR}/scripts/backend/checkstatus.sh "${JAILNAME}"
if [ "$?" = "0" ] ; then
- echo "ERROR: Jail is still running, or has active mount-points.. Please stop manually."
+ echo "ERROR: Jail is still running! Please stop manually."
+ exit 5
+fi
+
+# Check if anything is still mounted in this jail
+hasmount=0
+for mountpoint in $(mount | grep -e "${JAILDIR}/" | cut -d" " -f3); do
+ hasmount=1
+done
+if [ $hasmount -eq 1 ] ; then
+ echo "ERROR: Jail still has active mount points. Please unmount them manually."
exit 5
fi
Please sign in to comment.
Something went wrong with that request. Please try again.