]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Updated init scripts to enable automatic sharing of ZFS datasets.
authorGunnar Beutner <gunnar@beutner.name>
Sun, 3 Jul 2011 00:43:25 +0000 (02:43 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 6 Jul 2011 16:20:28 +0000 (09:20 -0700)
The relevant init scripts were updated so as to automatically share
ZFS datasets using "zfs share -a" at boot time.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
etc/init.d/zfs.fedora
etc/init.d/zfs.gentoo
etc/init.d/zfs.lsb
etc/init.d/zfs.lunar
etc/init.d/zfs.redhat

index bfed452ad694884b72d63ea6b0d9087570195b9b..70b7281060107e1a5a02e01b0e5280504ded42c9 100644 (file)
@@ -158,6 +158,8 @@ start()
        
        action $"Mounting ZFS filesystems not yet mounted: " $ZFS mount -a || return 152
 
+       action $"Exporting ZFS filesystems: " $ZFS share -a || return 153
+
        read_mtab  "^/dev/zd"
        read_fstab "^/dev/zd"
 
index d7e1d1055033d24b010237c69834a05b8fe6f5d6..f709ed9e7d6bc2406fbf5e01d82e48f30e816ae7 100644 (file)
@@ -77,6 +77,15 @@ start() {
                return $rv
        fi
 
+       einfo "Exporting ZFS filesystems"
+       $ZFS share -a
+       rv=$?
+       if [ $rv -ne 0 ]; then
+               eerror "Failed to export ZFS filesystems."
+               eend $rv
+               return $rv
+       fi
+
        eend 0
        return 0
 }
index c342a6b5cd70fc27160fd9fc94d7c87e352fec0e..ce541a9cd08bbf860b3441f6cdc7a59b86fb418c 100644 (file)
@@ -74,6 +74,10 @@ start()
                log_begin_msg "Mounting ZFS filesystems"
                $ZFS mount -a
                log_end_msg $?
+
+               log_begin_msg "Exporting ZFS filesystems"
+               $ZFS share -a
+               log_end_msg $?
        fi
        
        touch $LOCKFILE
index c77b2b7808967f43f008488fb7d434c67d73f319..bdc461af861b258dfc9dda6ebee254e78788e580 100644 (file)
@@ -42,6 +42,14 @@ case $1 in
       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
+
 
   ;;
 
index 3f34f2febb145bbbf2fe1ba939132c602e8ca156..c1f2fb833a6eb436edadb1d52e32bb00203e0e49 100644 (file)
@@ -87,6 +87,8 @@ start()
 
        action $"Mounting automounted ZFS filesystems: " $ZFS mount -a || return 152
 
+       action $"Exporting ZFS filesystems: " $ZFS share -a || return 153
+
        # Read fstab, try to mount zvols ignoring error
        read_fstab "^/dev/(zd|zvol)"
        template=$"Mounting volume %s registered in fstab: "