4 # Provides: shareiscsi sharenfs sharesmb zfs-share
5 # Required-Start: $local_fs $network $remote_fs
6 # Required-Stop: $local_fs $network $remote_fs
7 # Default-Start: 2 3 4 5
9 # Should-Start: iscsi iscsitarget istgt nfs-kernel-server samba
10 # Should-Stop: iscsi iscsitarget istgt nfs-kernel-server samba
11 # Short-Description: Network share ZFS datasets.
12 # Description: Run the `zfs share -a` or `zfs unmount -a` commands
13 # for controlling iSCSI, NFS, or CIFS network shares.
16 PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
18 .
/lib
/lsb
/init-functions
19 # Do not source /lib/init/*.sh as they are not public APIs after getting rid
20 # of /lib/init/rw. However, this line may help when doing back port to older
25 [ -f /etc
/default
/zfs
] && .
/etc
/default
/zfs
29 log_begin_msg
"Sharing ZFS filesystems"
30 log_progress_msg
"filesystems"
34 if [ $RET != 0 ] ; then
44 log_begin_msg
"Unsharing ZFS filesystems"
45 log_progress_msg
"filesystems"
49 # Ignore a non-zero `zfs` result so that a busy ZFS instance
50 # does not hang the system during shutdown.
51 if [ $RET != 0 ] ; then
61 ([Oo
][Ff
][Ff
]|
[Nn
][Oo
]|
'')
68 case "$ZFS_UNSHARE" in
69 ([Oo
][Ff
][Ff
]|
[Nn
][Oo
]|
'')
75 (force-reload|reload|restart|status
)
80 [ -n "$1" ] && echo "Error: Unknown command $1."
81 echo "Usage: $0 {start|stop}"