Add L2ARC tunables
[zfs.git] / etc / init.d / zfs.lunar
index c7aa1ed..bdc461a 100644 (file)
@@ -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";