Wait 10 minutes before calling umount; pstree output

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2022-11-19 18:18:06 +02:00
parent aa724ba74f
commit e76504900b
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 30 additions and 8 deletions

View File

@ -17,7 +17,7 @@
Summary: Tools for building live CDs
Name: livecd-tools
Version: 31.0
Release: 2.0.riscv64%{?dist}
Release: 2.1.riscv64%{?dist}
%if 0%{?fedora}
Epoch: 1
%endif
@ -229,6 +229,10 @@ rm -rfv %{buildroot}%{_mandir}/man8/livecd-iso-to-*
%endif
%changelog
* Sat Nov 19 2022 David Abdurachmanov <davidlt@rivosinc.com> - 1:31.0-2.1.riscv64
- Wait 600 seconds before calling umount
- Dump pstree output with pids
* Sat Nov 19 2022 David Abdurachmanov <davidlt@rivosinc.com> - 1:31.0-2.0.riscv64
- Collect more information what is blocking mount point

View File

@ -1,43 +1,61 @@
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index f999d05..2007d34 100644
index f999d05..83a8928 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -822,6 +822,12 @@ class DiskMount(Mount):
@@ -820,8 +820,18 @@ class DiskMount(Mount):
def unmount(self):
if self.mounted:
logging.info("Unmounting directory %s" % self.mountdir)
+ time.sleep(600)
rc = call(['umount', self.mountdir])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ call(['lsof', self.mountdir])
+ call(['lsof', '+c0', self.mountdir])
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ call(['fuser', '-v', '-m', self.mountdir])
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.mountdir])
raise MountError(umount_fail_fmt % self.mountdir)
self.mounted = False
@@ -983,6 +989,12 @@ class OverlayFSMount(Mount):
@@ -981,8 +991,18 @@ class OverlayFSMount(Mount):
if not self.mounted:
return
+ time.sleep(600)
rc = call(['umount', self.mountdir])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ call(['lsof', self.mountdir])
+ call(['lsof', '+c0', self.mountdir])
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ call(['fuser', '-v', '-m', self.mountdir])
+ logging.info("- - - fuser %s - - -" % self.mountdir)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.mountdir])
raise MountError(umount_fail_fmt % self.mountdir)
if self.cowmnt:
@@ -1061,6 +1073,12 @@ class BindChrootMount():
@@ -1059,8 +1079,18 @@ class BindChrootMount():
self.mounted = False
return
+ time.sleep(600)
rc = call(['umount', self.dest])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.dest)
+ call(['lsof', self.dest])
+ call(['lsof', '+c0', self.dest])
+ logging.info("- - - lsof %s - - -" % self.dest)
+ logging.info("- - - fuser %s - - -" % self.dest)
+ call(['fuser', '-v', '-m', self.dest])
+ logging.info("- - - fuser %s - - -" % self.dest)
+ logging.info("- - - pstree - - -")
+ call(['pstree', '-Talp'])
+ logging.info("- - - pstree - - -")
call(['umount', '-l', self.dest])
raise MountError(umount_fail_fmt % self.dest)
self.mounted = False