Print this page
11083 support NFS server in zone
Portions contributed by: Dan Kruchinin <dan.kruchinin@nexenta.com>
Portions contributed by: Stepan Zastupov <stepan.zastupov@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Portions contributed by: Mike Zeller <mike@mikezeller.net>
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Portions contributed by: Gordon Ross <gordon.w.ross@gmail.com>
Portions contributed by: Vitaliy Gusev <gusev.vitaliy@gmail.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Jason King <jbk@joyent.com>
Reviewed by: C Fraire <cfraire@me.com>
Change-Id: I22f289d357503f9b48a0bc2482cc4328a6d43d16

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fs.d/nfs/svc/nfs-server
          +++ new/usr/src/cmd/fs.d/nfs/svc/nfs-server
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16  # If applicable, add the following below this CDDL HEADER, with the
  17   17  # fields enclosed by brackets "[]" replaced with your own identifying
  18   18  # information: Portions Copyright [yyyy] [name of copyright owner]
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  
  23   23  #
  24   24  # Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  25      -# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  26   25  # Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
       26 +# Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  27   27  #
  28   28  
  29   29  # Start/stop processes required for server NFS
  30   30  
  31   31  . /lib/svc/share/smf_include.sh
  32   32  . /lib/svc/share/ipf_include.sh
  33   33  zone=`smf_zonename`
  34   34  
  35   35  #
  36   36  # Handling a corner case here. If we were in offline state due to an
↓ open down ↓ 9 lines elided ↑ open up ↑
  46   46  # when the file is missing.
  47   47  #
  48   48  configure_ipfilter()
  49   49  {
  50   50          ipfile=`fmri_to_file $SMF_FMRI $IPF_SUFFIX`
  51   51          ip6file=`fmri_to_file $SMF_FMRI $IPF6_SUFFIX`
  52   52          [ -f "$ipfile" -a -f "$ip6file" ] && return 0
  53   53  
  54   54          #
  55   55          # Nothing to do if:
  56      -        # - ipfilter isn't online 
       56 +        # - ipfilter isn't online
  57   57          # - global policy is 'custom'
  58   58          # - service's policy is 'use_global'
  59   59          #
  60   60          service_check_state $IPF_FMRI $SMF_ONLINE || return 0
  61   61          [ "`get_global_def_policy`" = "custom" ] && return 0
  62   62          [ "`get_policy $SMF_FMRI`" = "use_global" ] && return 0
  63   63  
  64   64          svcadm restart $IPF_FMRI
  65   65  }
  66   66  
  67   67  case "$1" in
  68   68  'start')
  69      -        # The NFS server is not supported in a local zone
  70      -        if smf_is_nonglobalzone; then
  71      -                /usr/sbin/svcadm disable -t svc:/network/nfs/server
  72      -                echo "The NFS server is not supported in a local zone"
  73      -                sleep 5 &
  74      -                exit $SMF_EXIT_OK
  75      -        fi
  76      -
  77   69          # Share all file systems enabled for sharing. sharemgr understands
  78   70          # regular shares and ZFS shares and will handle both. Technically,
  79   71          # the shares would have been started long before getting here since
  80   72          # nfsd has a dependency on them.
  81   73  
  82   74          # restart stopped shares from the repository
  83   75          /usr/sbin/sharemgr start -P nfs -a
  84   76  
  85   77          # Options for nfsd are now set in SMF
  86   78  
↓ open down ↓ 236 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX