M #-: Replace real mount check for flag check

Because MOUNT_DIR can be different than real MOUNT_DIR,
so we would need to pass it to realpath. Which is not on
some legacy systems like RHEL 6 or Ubuntu 14.04.
pull/232/head
Vlastimil Holer 4 years ago
parent 9d4d93eaa7
commit d1f4d3a97d
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -171,6 +171,7 @@ function get_new_context {
;;
esac
_mount_dir_mounted=no
if [ -e "${dev_context}" ]; then
mount_dir
@ -198,6 +199,7 @@ function get_new_context {
exit 1
fi
_mount_dir_mounted=yes
context_sh $MOUNT_DIR
elif find '/context' -mindepth 1 -print 2>/dev/null | grep -q .; then
@ -308,17 +310,17 @@ function acquire_lock {
function cleanup {
# unmount context
if [ -d "${MOUNT_DIR}" ]; then
if mount | grep -q " ${MOUNT_DIR} "; then
if [ "x${_mount_dir_mounted}" = 'xyes' ]; then
log debug "Unmounting ${MOUNT_DIR}"
if [ "$distro" = 'Linux' ]; then
umount -l "${MOUNT_DIR}"
umount -l "${MOUNT_DIR}"
elif [ "$distro" = 'BSD' ]; then
umount "${MOUNT_DIR}"
umount "${MOUNT_DIR}"
fi
fi
rm -r "${MOUNT_DIR}"
rm -rf "${MOUNT_DIR}"
fi
# remove remporary files

Loading…
Cancel
Save