The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/etc/init.d/zfs-share.in

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #!@DEFAULT_INIT_SHELL@
    2 # shellcheck disable=SC2154
    3 #
    4 # zfs-share     This script will network share zfs filesystems and volumes.
    5 #
    6 # chkconfig:    2345 30 99
    7 # description:  Run the `zfs share -a` or `zfs unshare -a` commands
    8 #               for controlling iSCSI, NFS, or CIFS network shares.
    9 # probe: true
   10 #
   11 ### BEGIN INIT INFO
   12 # Provides:          zfs-share
   13 # Required-Start:    $local_fs $network $remote_fs zfs-mount
   14 # Required-Stop:     $local_fs $network $remote_fs zfs-mount
   15 # Default-Start:     2 3 4 5
   16 # Default-Stop:      0 1 6
   17 # Should-Start:      iscsi iscsitarget istgt scst @DEFAULT_INIT_NFS_SERVER@ samba samba4 zfs-mount zfs-zed
   18 # Should-Stop:       iscsi iscsitarget istgt scst @DEFAULT_INIT_NFS_SERVER@ samba samba4 zfs-mount zfs-zed
   19 # Short-Description: Network share ZFS datasets and volumes.
   20 # Description:       Run the `zfs share -a` or `zfs unshare -a` commands
   21 #                    for controlling iSCSI, NFS, or CIFS network shares.
   22 ### END INIT INFO
   23 #
   24 # Released under the 2-clause BSD license.
   25 #
   26 # This script is based on debian/zfsutils.zfs.init from the
   27 # Debian GNU/kFreeBSD zfsutils 8.1-3 package, written by Aurelien Jarno.
   28 
   29 # Source the common init script
   30 . @sysconfdir@/zfs/zfs-functions
   31 
   32 # ----------------------------------------------------
   33 
   34 do_depend()
   35 {
   36         after sysfs zfs-mount zfs-zed
   37         keyword -lxc -openvz -prefix -vserver
   38 }
   39 
   40 do_start()
   41 {
   42         check_boolean "$ZFS_SHARE" || exit 0
   43 
   44         check_module_loaded "zfs" || exit 0
   45 
   46         zfs_action "Sharing ZFS filesystems" "$ZFS" share -a
   47 }
   48 
   49 do_stop()
   50 {
   51         check_boolean "$ZFS_UNSHARE" || exit 0
   52 
   53         check_module_loaded "zfs" || exit 0
   54 
   55         zfs_action "Unsharing ZFS filesystems" "$ZFS" unshare -a
   56 }
   57 
   58 # ----------------------------------------------------
   59 
   60 if [ ! -e /sbin/openrc-run ]; then
   61         case "$1" in
   62                 start)
   63                         do_start
   64                         ;;
   65                 stop)
   66                         do_stop
   67                         ;;
   68                 force-reload|reload|restart|status)
   69                         # no-op
   70                         ;;
   71                 *)
   72                         [ -n "$1" ] && echo "Error: Unknown command $1."
   73                         echo "Usage: $0 {start|stop}"
   74                         exit 3
   75                         ;;
   76         esac
   77 
   78         exit $?
   79 else
   80         # Create wrapper functions since Gentoo don't use the case part.
   81         depend() { do_depend; }
   82         start() { do_start; }
   83         stop() { do_stop; }
   84 fi

Cache object: a818baa4e3b10c1152e5b55bfa386f7e


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.