X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=etc%2Finit.d%2Fzfs.lunar;h=bdc461af861b258dfc9dda6ebee254e78788e580;hb=22872ff5da0d12fe393e40d3e4b3c5a58d93e360;hp=c7aa1edb46e3fa2115f0aa3e0dc60e0dfe3ce731;hpb=712f8bd87b2d3799107e102652875996fa59647b;p=zfs.git diff --git a/etc/init.d/zfs.lunar b/etc/init.d/zfs.lunar index c7aa1ed..bdc461a 100644 --- a/etc/init.d/zfs.lunar +++ b/etc/init.d/zfs.lunar @@ -13,6 +13,9 @@ case $1 in start) echo "$1ing ZFS filesystems" + # Delay until all required block devices are present. + udevadm settle + if ! grep "zfs" /proc/modules > /dev/null; then echo "ZFS kernel module not loaded yet; loading..."; if ! modprobe zfs; then @@ -28,16 +31,24 @@ case $1 in # do, thus i'm not breaking here. fi - # mount the filesystems - while IFS= read -r -d $'\n' dev; do - mdev=$(echo "$dev" | awk '{ print $1; }') - echo -n "mounting $mdev..." - if `zfs mount $mdev`; then - echo -e "done"; - else - echo -e "failed"; - fi - done < <(zfs list -H); + # mount the filesystems + while IFS= read -r -d $'\n' dev; do + mdev=$(echo "$dev" | awk '{ print $1; }') + echo -n "mounting $mdev..." + if zfs mount $mdev; then + echo -e "done"; + else + echo -e "failed"; + fi + done < <(zfs list -H); + + # export the filesystems + echo -n "exporting ZFS filesystems..." + if zfs share -a; then + echo -e "done"; + else + echo -e "failed"; + fi ;; @@ -49,7 +60,7 @@ case $1 in while IFS= read -r -d $'\n' dev; do mdev=$(echo "$dev" | awk '{ print $1 }'); echo -n "umounting $mdev..."; - if `zfs umount $mdev`; then + if zfs umount $mdev; then echo -e "done"; else echo -e "failed";