Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Dec 2016 10:47:10 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-fs@FreeBSD.org
Subject:   [Bug 212318] sysutils/fusefs-libs: fails to unmount due to a uniq dev node
Message-ID:  <bug-212318-3630-LiYrErfkr5@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-212318-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-212318-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212318

--- Comment #3 from Melvyn Sopacua <m.r.sopacua@gmail.com> ---
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 on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212318-3630-LiYrErfkr5>