From d39c8dfd5a06ae1ce0edb31600e8ed7da2ac02dd Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Thu, 26 Oct 2023 13:42:08 -0400 Subject: [PATCH] ignore exit codes of umount during cleanup function because the cleanup function gets run by the error handler and should not be nested --- grml-debootstrap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grml-debootstrap b/grml-debootstrap index 5173dc1..29ae03f 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -272,17 +272,17 @@ cleanup() { fi done - [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount -a >/dev/null 2>&1 + [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount -a >/dev/null 2>&1 || true # ugly, but make sure we really don't leave anything (/proc /proc and # /dev /dev are intended, trying to work around timing issues, see #657023) for ARG in /run/udev /sys /proc /proc /dev/pts /dev/pts /dev /dev ; do - [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount $ARG >/dev/null 2>&1 - umount "$MNTPOINT"/$ARG >/dev/null 2>&1 + [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount $ARG >/dev/null 2>&1 || true + umount "$MNTPOINT"/$ARG >/dev/null 2>&1 || true done if [ -n "$ISODIR" ] ; then - [ -d "$MNTPOINT/$ISODIR" ] && umount "$MNTPOINT/$ISODIR" >/dev/null 2>&1 + [ -d "$MNTPOINT/$ISODIR" ] && umount "$MNTPOINT/$ISODIR" >/dev/null 2>&1 || true fi if [ -n "$DIRECTORY" ] ; then -- 2.1.4