[Bug 212318] sysutils/fusefs-libs: fails to unmount due to a uniq dev node

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Dec 21 10:47:10 UTC 2016


--- Comment #3 from Melvyn Sopacua <m.r.sopacua at 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}
                /sbin/umount ${ntfsmount_mountpoint}

check_is_mounted() {
        local mp is_mounted

        is_mounted=`/sbin/mount -p|sed -ne
        if [ ! -z "${is_mounted}" -a x"${is_mounted}" = x"${mp}" ]
                return 0
        return 1

This does the right thing for me. As for the code you've shown, it seems like a
bug to use fstat, as you can never get the path it is mounted *on* from that.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the freebsd-bugs mailing list