Basically yes, although my version is even simpler (and therefore probably less elegant): Code: pp900-a:/sbin# diff closechroot closechroot.old --- closechroot +++ closechroot.old @@ -29,7 +29,7 @@ fi #Abort if chroot not mounted. -if [ "$IMGFILE" != "none" ] && [ ! -f "$CHROOT/var/lock/qmount-complete" ] ; then +if [ ! -f "$CHROOT/var/lock/qmount-complete" ] ; then echo "Nothing to do; chroot not mounted!" - exit 1 + #exit 1 fi I don't remember the details but when I had some problems with lingering mounts I decided to use steamroller tactics. All you have to do is make sure everything that was mounted gets unmounted afterwards.
pp900-a:/sbin# diff closechroot closechroot.old --- closechroot +++ closechroot.old @@ -29,7 +29,7 @@ fi #Abort if chroot not mounted. -if [ "$IMGFILE" != "none" ] && [ ! -f "$CHROOT/var/lock/qmount-complete" ] ; then +if [ ! -f "$CHROOT/var/lock/qmount-complete" ] ; then echo "Nothing to do; chroot not mounted!" - exit 1 + #exit 1 fi