Print this page
7928 Add support for SMF_EXIT_TEMP_TRANSIENT

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ldmad/ldoms-agents
          +++ new/usr/src/cmd/ldmad/ldoms-agents
↓ open down ↓ 16 lines elided ↑ open up ↑
  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 2009 Sun Microsystems, Inc.  All rights reserved.
  25   25  # Use is subject to license terms.
  26   26  #
       27 +# Copyright 2017 RackTop Systems.
       28 +#
  27   29  
  28   30  . /lib/svc/share/smf_include.sh
  29   31  
  30   32  SVCNAME='Logical Domains agents'
  31   33  LDMAD='/usr/lib/ldoms/ldmad'
  32   34  VLDS='/devices/virtual-devices@100/channel-devices@200/virtual-domain-service@0:vlds'
  33   35  mach=`/sbin/uname -m`
  34   36  
  35   37  if [ "$mach" != "sun4v" ]; then
  36   38          echo "The $SVCNAME service is not supported on this platform."
  37   39          exit "$SMF_EXIT_ERR_FATAL"
  38   40  fi
  39   41  
  40   42  if smf_is_nonglobalzone; then
  41   43          echo "The $SVCNAME service has been disabled because " \
  42   44              "it is not supported in a local zone."
  43   45          /usr/sbin/svcadm disable "$SMF_FMRI"
  44      -        sleep 5 &
  45      -        exit "$SMF_EXIT_OK"
       46 +        exit "$SMF_EXIT_TEMP_TRANSIENT"
  46   47  fi
  47   48  
  48   49  #
  49   50  # The Logical Domains agents service is enabled by default on sun4v platforms.
  50   51  # However it can fail to start if the domain has a machine description in which
  51   52  # the vlds node is not defined (because it has an old MD or firmware). So we
  52   53  # check if a vlds device is effectively defined. If not then we disable the
  53   54  # service for this session. We don't return an error so that the service does
  54   55  # not go into the maintenance state and generate spurious error (especially if
  55   56  # the system is not configured with LDoms). The service is not permanently
  56   57  # disabled so that the service can come up if the domain is restarted with a
  57   58  # compatible MD.
  58   59  #
  59   60  if [ ! -c "$VLDS" ]; then
  60   61          echo "The $SVCNAME service has been disabled because the system" \
  61   62              "has no virtual domain service (vlds) device."
  62   63          /usr/sbin/svcadm disable -t "$SMF_FMRI"
  63      -        sleep 5 &
  64      -        exit "$SMF_EXIT_OK"
       64 +        exit "$SMF_EXIT_TEMP_TRANSIENT"
  65   65  fi
  66   66  
  67   67  if [ ! -x "$LDMAD" ]; then
  68   68          echo "The $SVCNAME service requires the $LDMAD executable." 
  69   69          exit "$SMF_EXIT_ERR_CONFIG"
  70   70  fi
  71   71  
  72   72  $LDMAD
  73   73  
  74   74  EXIT=$?
  75   75  
  76   76  if [ "$EXIT" != 0 ]; then
  77   77          exit "$EXIT"
  78   78  fi
  79   79  
  80   80  exit "$SMF_EXIT_OK"
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX