summarylogtreecommitdiffstats
path: root/enter-chroot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'enter-chroot.sh')
-rw-r--r--enter-chroot.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/enter-chroot.sh b/enter-chroot.sh
index 6b3927376368..9edbbffee7f6 100644
--- a/enter-chroot.sh
+++ b/enter-chroot.sh
@@ -35,6 +35,18 @@ monitor_chroot_exit() {
fi
done < $MOUNT_POINT/exit.fifo
+ if grep -qs "$MOUNT_POINT/sys" /proc/mounts
+ then umount -l $MOUNT_POINT/sys
+ fi
+
+ if grep -qs "$MOUNT_POINT/dev" /proc/mounts
+ then umount -l $MOUNT_POINT/dev
+ fi
+
+ if grep -qs "$MOUNT_POINT/proc" /proc/mounts
+ then umount -l $MOUNT_POINT/proc
+ fi
+
# Send a SIGTERM signal to the parent process (which is running the chroot command)
kill -s TERM $$
}