diff options
author | noobping | 2023-04-02 16:15:52 +0200 |
---|---|---|
committer | noobping | 2023-04-02 16:15:52 +0200 |
commit | 30013acb34c6d173158d578873f6dce447977d49 (patch) | |
tree | 0af3fba091a2d1650533d41685dbbb79ce70370b /enter-chroot.sh | |
parent | 3bb4b791c831b0cc8b71e8648f4962ebaf91f59b (diff) | |
download | aur-alpine-minirootfs.tar.gz |
Fix posseble unmount host sys, proc and dev folders.
Diffstat (limited to 'enter-chroot.sh')
-rw-r--r-- | enter-chroot.sh | 12 |
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 $$ } |