More verbose logging for arm32 umount
authorjashook <jashoo@microsoft.com>
Wed, 20 Jul 2016 22:04:38 +0000 (15:04 -0700)
committerJarret Shook <jashoo@Jarrets-MacBook-Pro.local>
Thu, 21 Jul 2016 04:41:11 +0000 (21:41 -0700)
Umount fails occasionaly in the arm32 ci script. Add some logging
information using lsof before calling umount to diagnose which files are
open.

tests/scripts/arm32_ci_script.sh

index 223da2e..e388127 100755 (executable)
@@ -102,7 +102,15 @@ function check_git_head {
 function unmount_rootfs {
     local rootfsFolder="$1"
 
-    if grep -qs "$rootfsFolder" /proc/mounts; then
+    #Check if there are any open files in this directory.
+    if [ -d $rootfsFolder ]; then
+        #If we find information about the file
+        if sudo lsof +D $rootfsFolder; then
+            (set +x; echo 'See above for lsof information. Continuing with the build.')
+        fi
+    fi
+
+    if mountpoint -q -- "$rootfsFolder"; then
         sudo umount "$rootfsFolder"
     fi
 }