[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] daemon: Run lsof when an umount command fails in umount_all call.



Useful for debugging unmount failures.  Note that we include lsof in
the appliance already.
---
 daemon/mount.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/daemon/mount.c b/daemon/mount.c
index c5b7d89..e139482 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -424,6 +424,10 @@ do_umount_all (void)
     r = command (NULL, &err, str_umount, mounts.argv[i], NULL);
     if (r == -1) {
       reply_with_error ("umount: %s: %s", mounts.argv[i], err);
+      if (verbose) {
+        /* Try running lsof to see what is holding the mountpoint open. */
+        command (NULL, NULL, "lsof", mounts.argv[i], NULL);
+      }
       free_stringslen (mounts.argv, mounts.size);
       return -1;
     }
-- 
2.4.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]