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

--- Comment #3 from Melvyn Sopacua <[email protected]> ---
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.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to