36 # Handling a corner case here. If we were in offline state due to an
  37 # unsatisfied dependency, the ipf_method process wouldn't have generated
  38 # the ipfilter configuration. When we transition to online because the
  39 # dependency is satisfied, the start method will have to generate the
  40 # ipfilter configuration. To avoid all possible deadlock scenarios,
  41 # we restart ipfilter which will regenerate the ipfilter configuration
  42 # for the entire system.
  43 #
  44 # The ipf_method process signals that it didn't generate ipf rules by
  45 # removing the service's ipf file. Thus we only restart network/ipfilter
  46 # when the file is missing.
  47 #
  48 configure_ipfilter()
  49 {
  50         ipfile=`fmri_to_file $SMF_FMRI $IPF_SUFFIX`
  51         ip6file=`fmri_to_file $SMF_FMRI $IPF6_SUFFIX`
  52         [ -f "$ipfile" -a -f "$ip6file" ] && return 0
  53 
  54         #
  55         # Nothing to do if:
  56         # - ipfilter isn't online
  57         # - global policy is 'custom'
  58         #
  59         [ "`get_policy $SMF_FMRI`" = "use_global" ] && return 0
  60         service_check_state $IPF_FMRI $SMF_ONLINE || return 0
  61         [ "`get_global_def_policy`" = "custom" ] && return 0
  62 
  63         svcadm restart $IPF_FMRI
  64 }
  65 
  66 case "$1" in
  67 'start')
  68         # Share all file systems enabled for sharing. sharemgr understands
  69         # regular shares and ZFS shares and will handle both. Technically,
  70         # the shares would have been started long before getting here since
  71         # nfsd has a dependency on them.
  72 
  73         # restart stopped shares from the repository
  74         /usr/sbin/sharemgr start -P nfs -a
  75 
 
 | 
 
 
  36 # Handling a corner case here. If we were in offline state due to an
  37 # unsatisfied dependency, the ipf_method process wouldn't have generated
  38 # the ipfilter configuration. When we transition to online because the
  39 # dependency is satisfied, the start method will have to generate the
  40 # ipfilter configuration. To avoid all possible deadlock scenarios,
  41 # we restart ipfilter which will regenerate the ipfilter configuration
  42 # for the entire system.
  43 #
  44 # The ipf_method process signals that it didn't generate ipf rules by
  45 # removing the service's ipf file. Thus we only restart network/ipfilter
  46 # when the file is missing.
  47 #
  48 configure_ipfilter()
  49 {
  50         ipfile=`fmri_to_file $SMF_FMRI $IPF_SUFFIX`
  51         ip6file=`fmri_to_file $SMF_FMRI $IPF6_SUFFIX`
  52         [ -f "$ipfile" -a -f "$ip6file" ] && return 0
  53 
  54         #
  55         # Nothing to do if:
  56         # - service's policy is 'use_global'
  57         # - ipfilter isn't online
  58         # - global policy is 'custom'
  59         #
  60         [ "`get_policy $SMF_FMRI`" = "use_global" ] && return 0
  61         service_check_state $IPF_FMRI $SMF_ONLINE || return 0
  62         [ "`get_global_def_policy`" = "custom" ] && return 0
  63 
  64         svcadm restart $IPF_FMRI
  65 }
  66 
  67 case "$1" in
  68 'start')
  69         # Share all file systems enabled for sharing. sharemgr understands
  70         # regular shares and ZFS shares and will handle both. Technically,
  71         # the shares would have been started long before getting here since
  72         # nfsd has a dependency on them.
  73 
  74         # restart stopped shares from the repository
  75         /usr/sbin/sharemgr start -P nfs -a
  76 
 
 |