From owner-freebsd-ports-bugs@freebsd.org Wed Dec 21 10:47:10 2016 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF5FAC8A3A0 for ; Wed, 21 Dec 2016 10:47:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7C2190A for ; Wed, 21 Dec 2016 10:47:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uBLAl9W0058180 for ; Wed, 21 Dec 2016 10:47:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 212318] sysutils/fusefs-libs: fails to unmount due to a uniq dev node Date: Wed, 21 Dec 2016 10:47:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: m.r.sopacua@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 10:47:10 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212318 --- Comment #3 from Melvyn Sopacua --- I have several nodes all using /dev/fuse, but I'm using an rc.d script to mount/unmount them, which is run by root. My unmounting part is this: ntfsmount_unmount() { # We can't check this, since mount -p with path argument only checks # nodes in fstab(5). # if /sbin/mount -p ${ntfsmount_mountpoint} >/dev/null 2>&1 # So we need to envoke mount -p without argument and grep for the # mountpoint instead. if check_is_mounted ${ntfsmount_mountpoint} then /sbin/umount ${ntfsmount_mountpoint} fi } check_is_mounted() { local mp is_mounted mp=3D"$1" is_mounted=3D`/sbin/mount -p|sed -ne "s,^/dev/fuse.*[[:space:]]\(${mp}\)[[:space:]].*$,\\1,p"` if [ ! -z "${is_mounted}" -a x"${is_mounted}" =3D x"${mp}" ] then return 0 fi return 1 } This does the right thing for me. As for the code you've shown, it seems li= ke a bug to use fstat, as you can never get the path it is mounted *on* from tha= t. --=20 You are receiving this mail because: You are the assignee for the bug.=