X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=etc%2Finit.d%2Fzfs.gentoo;h=a33d9dc29a2eced25ea35d7183b1e95ea2fa058c;hb=5c03efc379693f992ebe39c6a00c7297c4a304ea;hp=5c329cea7c6148b65423b6a5885f2042705a1fbf;hpb=04c22478a7365622a8f3c7fd7d0046fe41813075;p=zfs.git diff --git a/etc/init.d/zfs.gentoo b/etc/init.d/zfs.gentoo index 5c329ce..a33d9dc 100644 --- a/etc/init.d/zfs.gentoo +++ b/etc/init.d/zfs.gentoo @@ -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 @@ -41,6 +41,10 @@ checksystem() { start() { ebegin "Starting ZFS" checksystem || return 1 + + # Delay until all required block devices are present. + udevadm settle + if [ ! -c /dev/zfs ]; then modprobe $ZFS_MODULE rv=$? @@ -75,17 +79,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 +87,7 @@ stop() { ebegin "Unmounting ZFS filesystems" $ZFS umount -a + rv=$? if [ $rv -ne 0 ]; then eerror "Failed to umount ZFS filesystems." fi