Collect more information what is blocking mount point

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2022-11-19 15:51:38 +02:00
parent d98ce07573
commit aa724ba74f
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 64 additions and 1 deletions

View File

@ -17,7 +17,7 @@
Summary: Tools for building live CDs
Name: livecd-tools
Version: 31.0
Release: 2%{?dist}
Release: 2.0.riscv64%{?dist}
%if 0%{?fedora}
Epoch: 1
%endif
@ -25,6 +25,8 @@ License: GPLv2
URL: https://github.com/livecd-tools/livecd-tools
Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.gz
Patch0: test-fix.patch
BuildRequires: make
%if %{with python2}
BuildRequires: python2-devel
@ -63,6 +65,8 @@ Requires: dosfstools >= 2.11-8
Requires: e2fsprogs
Requires: lorax >= 18.3
Requires: rsync
Requires: lsof
Requires: psmisc
%if ! 0%{?rhel}
# hfs+ support for Macs
@ -225,6 +229,9 @@ rm -rfv %{buildroot}%{_mandir}/man8/livecd-iso-to-*
%endif
%changelog
* Sat Nov 19 2022 David Abdurachmanov <davidlt@rivosinc.com> - 1:31.0-2.0.riscv64
- Collect more information what is blocking mount point
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:31.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

56
test-fix.patch Normal file
View File

@ -0,0 +1,56 @@
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index f999d05..2007d34 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -822,6 +822,12 @@ class DiskMount(Mount):
logging.info("Unmounting directory %s" % self.mountdir)
rc = call(['umount', self.mountdir])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ call(['lsof', 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)
call(['umount', '-l', self.mountdir])
raise MountError(umount_fail_fmt % self.mountdir)
self.mounted = False
@@ -983,6 +989,12 @@ class OverlayFSMount(Mount):
rc = call(['umount', self.mountdir])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.mountdir)
+ call(['lsof', 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)
call(['umount', '-l', self.mountdir])
raise MountError(umount_fail_fmt % self.mountdir)
if self.cowmnt:
@@ -1061,6 +1073,12 @@ class BindChrootMount():
rc = call(['umount', self.dest])
if rc != 0:
+ logging.info("- - - lsof %s - - -" % self.dest)
+ call(['lsof', 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)
call(['umount', '-l', self.dest])
raise MountError(umount_fail_fmt % self.dest)
self.mounted = False
diff --git a/imgcreate/util.py b/imgcreate/util.py
index fad6772..04380c9 100644
--- a/imgcreate/util.py
+++ b/imgcreate/util.py
@@ -32,7 +32,7 @@ def call(*popenargs, **kwargs):
stderr=subprocess.STDOUT, **kwargs)
rc = p.wait()
fp = io.open(p.stdout.fileno(), mode="r", encoding="utf-8", closefd=False)
- stdout = fp.read().split()
+ stdout = fp.read().splitlines()
fp.close()
# Log output using logging module