[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


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212318

--- 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}
        then
                /sbin/umount ${ntfsmount_mountpoint}
        fi
}

check_is_mounted() {
        local mp is_mounted

        mp="$1"
        is_mounted=`/sbin/mount -p|sed -ne
"s,^/dev/fuse.*[[:space:]]\(${mp}\)[[:space:]].*$,\\1,p"`
        if [ ! -z "${is_mounted}" -a x"${is_mounted}" = x"${mp}" ]
        then
                return 0
        fi
        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-fs mailing list