Tear down and flush the mmap region
[zfs.git] / etc / init.d / zfs.gentoo
index 5c329ce..c9c5d85 100644 (file)
@@ -21,7 +21,7 @@ checksystem() {
                return 0
        else
                einfo "Checking if ZFS modules present"
-               if [ -e  $(modprobe -l  $ZFS_MODULE | grep -q  $ZFS_MODULE) ]; then
+               if [ "x$(modprobe -l  $ZFS_MODULE | grep $ZFS_MODULE)" == "x" ]; then
                        eerror "$ZFS_MODULE not found. Is the ZFS package installed?"
                        return 1
                fi
@@ -75,17 +75,6 @@ start() {
                return $rv
        fi
 
-       # hack to read mounted file systems because otherwise
-       # zfs returns EPERM when a non-root user reads a mounted filesystem before root did
-       savepwd="$PWD"
-       mount | grep " type zfs " | sed 's/.*on //' | sed 's/ type zfs.*$//' | \
-       while read line
-       do
-               cd "$line" &> /dev/null
-               ls &> /dev/null
-       done
-       cd "$savepwd"
-
        eend 0
        return 0
 }
@@ -94,6 +83,7 @@ stop()
 {
        ebegin "Unmounting ZFS filesystems"
        $ZFS umount -a
+       rv=$?
        if [ $rv -ne 0 ]; then
                eerror "Failed to umount ZFS filesystems."
        fi