From 3f2b2ef1466ae5846cd74cea47c395a1290d5719 Mon Sep 17 00:00:00 2001 From: downtownallday Date: Tue, 14 Sep 2021 08:17:21 -0400 Subject: [PATCH] Stop the capture daemon during ehdd shutdown to avoid "busy" mount --- ehdd/shutdown.sh | 9 +++++++++ ehdd/umount.sh | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ehdd/shutdown.sh b/ehdd/shutdown.sh index ad593289..0c04f3d5 100755 --- a/ehdd/shutdown.sh +++ b/ehdd/shutdown.sh @@ -9,6 +9,15 @@ if [ -s /etc/mailinabox.conf ]; then #systemctl stop nsd [ -x /usr/sbin/slapd ] && systemctl stop slapd systemctl stop fail2ban + systemctl stop miabldap-capture fi ehdd/umount.sh +code=$? +if [ $code -eq 2 ]; then + echo "Trying again in 10 seconds..." + sleep 10 + ehdd/umount.sh + code=$? +fi +exit $code diff --git a/ehdd/umount.sh b/ehdd/umount.sh index f12cef37..ed11b62a 100755 --- a/ehdd/umount.sh +++ b/ehdd/umount.sh @@ -6,6 +6,6 @@ if ! mount | grep "$EHDD_MOUNTPOINT" >/dev/null; then # not mounted exit 0 fi -umount "$EHDD_MOUNTPOINT" || exit 1 +umount "$EHDD_MOUNTPOINT" || exit 2 cryptsetup luksClose $EHDD_LUKS_NAME losetup -d $(find_inuse_loop)