summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <de@gsmk.de>2014-06-10 16:56:44 +0200
committererdgeist <de@gsmk.de>2014-06-10 16:56:44 +0200
commitfaf0f1fbdee796d89a313172e7bb3ce5dd73c411 (patch)
tree1a5352fb172ad2b5f6f94a3f4ff859d5115b0424
parent52e8ea4a164f444824d9783595351d091e0a4825 (diff)
Handle errors when destroying file systems for zfs jail
-rwxr-xr-xezjail-admin9
1 files changed, 8 insertions, 1 deletions
diff --git a/ezjail-admin b/ezjail-admin
index fb3fc1f..d18bb79 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -923,7 +923,14 @@ delete)
923 [ "${ezjail_image}" ] && rm -f "${ezjail_image}" "${ezjail_image%.img}.device" 923 [ "${ezjail_image}" ] && rm -f "${ezjail_image}" "${ezjail_image%.img}.device"
924 ;; 924 ;;
925 zfs) 925 zfs)
926 /sbin/zfs destroy -r ${ezjail_parentzfs}/${ezjail_hostname} 926 if ! /sbin/zfs destroy -r ${ezjail_parentzfs}/${ezjail_hostname}; then
927 [ "${ezjail_forcestop}" ] || exerr "Error: Could not destroy file system ${ezjail_parentzfs}/${ezjail_hostname} for jail ${ezjail_name}."
928 echo "Warning: Could not destroy file system ${ezjail_parentzfs}/${ezjail_hostname} for jail ${ezjail_name}."
929 echo " Sleeping 5 seconds before retrying forcefully."
930 sleep 5
931 /sbin/zfs destroy -rf ${ezjail_parentzfs}/${ezjail_hostname} || exerr "Error: Failed to destroy file system."
932 echo "Success."
933 fi
927 ;; 934 ;;
928 *) 935 *)
929 chflags -R noschg "${ezjail_rootdir}" 936 chflags -R noschg "${ezjail_rootdir}"