Bug 254322

Summary: devel/gvfs: should depend on sysutils/lsof
Product: Ports & Packages Reporter: Damjan Jovanovic <damjan.jov>
Component: Individual Port(s)Assignee: freebsd-gnome (Nobody) <gnome>
Status: Closed FIXED    
Severity: Affects Some People CC: fluffy, gerald, gnome, se
Priority: --- Flags: fluffy: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254024

Description Damjan Jovanovic 2021-03-16 01:29:11 UTC
When a drive can't be unmounted and returns EBUSY, gvfs calls "lsof -t /mountpoint" to find which processes have files open. This list is sent over the "show-processes" signal, which allows file managers to show which apps are preventing the unmount.

For this to work, sysutils/lsof needs to be around. The port should depend on it at runtime, ie. something along these lines:

--------
diff --git a/devel/gvfs/Makefile b/devel/gvfs/Makefile
index 830823c13ecc..aad75271e9c1 100644
--- a/devel/gvfs/Makefile
+++ b/devel/gvfs/Makefile
@@ -23,7 +23,8 @@ LIB_DEPENDS=  libgcrypt.so:security/libgcrypt \
                libudisks2.so:sysutils/libudisks \
                libsecret-1.so:security/libsecret
                
-RUN_DEPENDS=       bsdisks>0:sysutils/bsdisks
+RUN_DEPENDS= bsdisks>0:sysutils/bsdisks \
+         lsof:sysutils/lsof
 PORTSCOUT=     limitw:1,even
 
 USES=          gettext gnome libarchive localbase meson \
--------
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2021-03-16 10:43:03 UTC
^Triage: give this a correct Summary and assign.
Comment 2 Gerald Pfeifer freebsd_committer freebsd_triage 2022-09-19 02:08:07 UTC
This looks pretty straightforward and nicely debugged and described by
Damjan, alas no action for more than a year.

gnome@ would you mind looking into this?


If you approve, I'll commit (and I am tempted to apply this one liner
with maintainer timeout).

https://reviews.freebsd.org/D32018 has the same patch.
Comment 3 Dima Panov freebsd_committer freebsd_triage 2022-09-19 06:30:12 UTC
Go forward!

Dima, on behalf of desktop@
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-09-27 04:09:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c80f55d775ccc6a00cd9523b4fe781aa6171817a

commit c80f55d775ccc6a00cd9523b4fe781aa6171817a
Author:     Damjan Jovanovic <damjan.jov@gmail.com>
AuthorDate: 2022-09-27 03:45:15 +0000
Commit:     Gerald Pfeifer <gerald@FreeBSD.org>
CommitDate: 2022-09-27 04:08:12 +0000

    devel/gvfs: Depend on sysutils/lsof at run time

    When a drive cannot be unmounted and returns EBUSY, gvfs calls
    "lsof -t /mountpoint" to find which processes have files open.
    This list is sent over the "show-processes" signal, which allows
    file managers to show which apps are preventing the unmount.

    For this to work, sysutils/lsof needs to be around.

    PR:             254322
    Approved by:    desktop (fluffy)
    Differential Revision:  https://reviews.freebsd.org/D32018

 devel/gvfs/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Comment 5 Gerald Pfeifer freebsd_committer freebsd_triage 2022-09-27 04:11:28 UTC
Thank you for the patch and fine description, and thank you fluffy@
for review/approval.