From e5417d78a3aa7c596ef4075e1b0574838ae2d828 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 8 Jul 2021 22:35:18 +0900 Subject: [PATCH 1/4] Fix the unmount fails Trial fix. Change the --rbinds to --make-slave. #17 --- script/lib/common.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index ec076b5..b5fd1b4 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -296,7 +296,9 @@ function post_install() { # And mount other directories echo "...Mounting all other dirs." - for n in proc sys dev tmp etc/resolv.conf; do mount --rbind "/$n" "${TARGETMOUNTPOINT}/$n"; done + mount --make-slave "${TARGETMOUNTPOINT}" + mount --rbind /etc/resolv.conf "${TARGETMOUNTPOINT}"/resolv.conf +# for n in proc sys dev tmp etc/resolv.conf; do mount --rbind "/$n" "${TARGETMOUNTPOINT}/$n"; done # Copy all scripts to the target /tmp for using in chroot session. echo "...Copy files in current dir to ${TARGETMOUNTPOINT}/tmp." From c9b69412948af77851454653cb6644c1c0de3e1a Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 8 Jul 2021 22:48:19 +0900 Subject: [PATCH 2/4] Revert "Fix the unmount fails" This reverts commit e5417d78a3aa7c596ef4075e1b0574838ae2d828. --- script/lib/common.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index b5fd1b4..ec076b5 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -296,9 +296,7 @@ function post_install() { # And mount other directories echo "...Mounting all other dirs." - mount --make-slave "${TARGETMOUNTPOINT}" - mount --rbind /etc/resolv.conf "${TARGETMOUNTPOINT}"/resolv.conf -# for n in proc sys dev tmp etc/resolv.conf; do mount --rbind "/$n" "${TARGETMOUNTPOINT}/$n"; done + for n in proc sys dev tmp etc/resolv.conf; do mount --rbind "/$n" "${TARGETMOUNTPOINT}/$n"; done # Copy all scripts to the target /tmp for using in chroot session. echo "...Copy files in current dir to ${TARGETMOUNTPOINT}/tmp." From 2ae4d6cd269840e324150fbb12f00881ad074d44 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 8 Jul 2021 23:09:02 +0900 Subject: [PATCH 3/4] Add -l option ot unmount to surpress the "busy" error --- script/lib/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index ec076b5..ba80dff 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -315,9 +315,9 @@ function post_install() { source "lib/chrooted_job_${DISTRIBUTIONSIGNATURE}.sh" HEREDOC - # Unmount all + # Unmount all. -l ( lazy ) option is added to supress the busy error. echo "...Unmounting all." - umount -R "${TARGETMOUNTPOINT}" + umount -R -l "${TARGETMOUNTPOINT}" # Finishing message cat <<- HEREDOC From 20826f2f6903a2263ebcfcab88af068df9e178f3 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 8 Jul 2021 23:10:39 +0900 Subject: [PATCH 4/4] Update changelog Unmount fails #17 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1337cbf..af2b381 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Record of the modification in project development. ### Fixed - [Issue 8 : Wrong message after cancellation ](https://github.com/suikan4github/kaiten-yaki/8) - [Issue 15 : CITERTIME parameter is not passed to the chrooted_job ](https://github.com/suikan4github/kaiten-yaki/15) +- [Issue 17 : Unmount fails ](https://github.com/suikan4github/kaiten-yaki/17) ### Known Issue