Print this page
Split Close
Expand all
Collapse all
          --- /workspace/tf84964/oscds-s9-zone/webrev/usr/src/cmd/ha-services/gds-agents/zone/sczbt/sczbt_register.ksh-
          +++ sczbt_register.ksh
↓ open down ↓ 56 lines elided ↑ open up ↑
  57   57  fi
  58   58  
  59   59  # constructing the parameter file
  60   60  
  61   61  if [ ! -d ${PARAMETERDIR} ]; then
  62   62          echo "The value given for PARAMETERDIR (${PARAMETERDIR}) in sczbt_config is not a directory!"
  63   63          exit 1
  64   64  fi
  65   65  
  66   66  if [ ! -f ${PARAMETERDIR}/sczbt_${RS} ]; then
  67      -        cat > ${PARAMETERDIR}/sczbt_${RS} <<EOF
       67 +        /bin/cat > ${PARAMETERDIR}/sczbt_${RS} <<EOF
  68   68  #!/usr/bin/ksh
  69   69  #
  70      -# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
       70 +# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  71   71  # Use is subject to license terms.
  72   72  #
  73   73  #
  74   74  # Parameters for sczbt (Zone Boot)
  75   75  # 
  76   76  # Zonename      Name of the zone
  77   77  # Zonebrand     Brand of the zone. Current supported options are
  78      -#               "native" (default), "lx" or "solaris8"
       78 +#               "native" (default), "lx", "solaris8" or "solaris9"
  79   79  # Zonebootopt   Zone boot options ("-s" requires that Milestone=single-user)
  80   80  # Milestone     SMF Milestone which needs to be online before the zone is
  81   81  #               considered as booted. This option is only used for the
  82   82  #               "native" Zonebrand.
  83   83  # LXrunlevel    Runlevel which needs to get reached before the zone is
  84   84  #               considered booted. This option is only used for the "lx"
  85   85  #               Zonebrand.
  86   86  # SLrunlevel    Solaris legacy runlevel which needs to get reached before the
  87   87  #               zone is considered booted. This option is only used for the
  88      -#               "solaris8" Zonebrand.
       88 +#               "solaris8" or "solaris9" Zonebrand.
  89   89  # Mounts        Mounts is a list of directories and their mount options,
  90   90  #               which are loopback mounted from the global zone into the
  91   91  #               newly booted zone. The mountpoint in the local zone can
  92   92  #               be different to the mountpoint from the global zone.
  93   93  #
  94   94  #               The Mounts parameter format is as follows,
  95   95  #
  96   96  #               Mounts="/<global zone directory>:/<local zone directory>:<mount options>"
  97   97  #
  98   98  #               The following are valid examples for the "Mounts" variable
↓ open down ↓ 29 lines elided ↑ open up ↑
 128  128  fi
 129  129  
 130  130  
 131  131  # Checking dependencies for SC_NETWORK=true
 132  132  
 133  133  SC_NETWORK=`echo ${SC_NETWORK} | /usr/xpg4/bin/tr [:upper:] [:lower:]`
 134  134  
 135  135  if [ "${SC_NETWORK}" == "true" -a -z "${SC_LH}" ]
 136  136  then
 137  137          echo "Error: SC_LH is required with SC_NETWORK=true"
 138      -        rm ${PARAMETERDIR}/sczbt_${RS}
      138 +        /bin/rm ${PARAMETERDIR}/sczbt_${RS}
 139  139          exit 1
 140  140  fi
 141  141  
 142  142  # If the configured zone has set ip-type=exclusive, then assigning a
 143  143  # SUNW.LogicalHostname to this zone is not possible.
 144  144  
 145  145  IPTYPE=`/usr/sbin/zonecfg -z ${Zonename} info | /bin/grep "^ip-type:" | /bin/awk '{print $2}'`
 146  146  
 147  147  if [ "${IPTYPE}" == "exclusive" ] && [ "${SC_NETWORK}" == "true" ]
 148  148  then
 149  149          echo "Error: The zone ${Zonename} has set ip-type=exclusive. This can not be combined with setting SC_NETWORK=true."
 150      -        rm ${PARAMETERDIR}/sczbt_${RS}
      150 +        /bin/rm ${PARAMETERDIR}/sczbt_${RS}
 151  151          exit 1
 152  152  fi
 153  153  
 154  154  # Checking dependencies for FAILOVER=true
 155  155  
 156  156  FAILOVER=`echo ${FAILOVER} | /usr/xpg4/bin/tr [:upper:] [:lower:]`
 157  157  
 158  158  if [ "${FAILOVER}" == "true" -a -z "${HAS_RS}" ]
 159  159  then
 160  160          echo "Error: HAS_RS is required with FAILOVER=true"
 161      -        rm ${PARAMETERDIR}/sczbt_${RS}
      161 +        /bin/rm ${PARAMETERDIR}/sczbt_${RS}
 162  162          exit 1
 163  163  fi
 164  164  
 165  165  # Setting Resource_dependencies
 166  166  
 167  167  if  [ "${SC_LH}" ] 
 168  168  then
 169  169          RESOURCE_DEPENDENCIES="-y Resource_dependencies=${SC_LH}"
 170  170  else
 171  171          RESOURCE_DEPENDENCIES=
↓ open down ↓ 33 lines elided ↑ open up ↑
 205  205  -x Network_aware=false \
 206  206  -x Stop_signal=9 ${RESOURCE_DEPENDENCIES}
 207  207  
 208  208  fi
 209  209  
 210  210  St=$?
 211  211  
 212  212  if [ "${St}" -ne 0 ]; then
 213  213          echo "Registration of resource ${RS} failed, please correct the wrong parameters."
 214  214          echo "Removing parameterfile ${PARAMETERDIR}/sczbt_${RS} for resource ${RS}."
 215      -        rm ${PARAMETERDIR}/sczbt_${RS}
      215 +        /bin/rm ${PARAMETERDIR}/sczbt_${RS}
 216  216          exit 1
 217  217  else
 218  218          echo "Registration of resource ${RS} succeeded."
 219  219  fi
 220  220  
 221  221  # VALIDATE RESOURCE
 222  222  
 223  223  /opt/SUNWsczone/sczbt/bin/validate_sczbt -R ${RS} -G ${RG} -P ${PARAMETERDIR}
 224  224  
 225  225  St=$?
 226  226  
 227  227  if [ "${St}" -ne 0 ]; then
 228  228          echo "Validation of resource ${RS} failed, check the syslog for the wrong parameters."
 229  229          echo "Removing resource ${RS} from the cluster configuration."
 230  230  
 231  231          /usr/cluster/bin/scrgadm -r -j ${RS}
 232  232          echo "Removing parameterfile ${PARAMETERDIR}/sczbt_${RS} for resource ${RS}."
 233      -        rm ${PARAMETERDIR}/sczbt_${RS}
      233 +        /bin/rm ${PARAMETERDIR}/sczbt_${RS}
 234  234  
 235  235          exit 1
 236  236  else
 237  237          echo "Validation of resource ${RS} succeeded."
 238  238  fi
 239  239  
 240  240  exit 0
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX