Cdiff sczbt_register.ksh
*** /workspace/tf84964/oscds-s9-zone/webrev/usr/src/cmd/ha-services/gds-agents/zone/sczbt/sczbt_register.ksh- Fri Apr 11 08:32:33 2008
--- sczbt_register.ksh Thu Apr 10 07:18:52 2008
*** 62,93 ****
echo "The value given for PARAMETERDIR (${PARAMETERDIR}) in sczbt_config is not a directory!"
exit 1
fi
if [ ! -f ${PARAMETERDIR}/sczbt_${RS} ]; then
! cat > ${PARAMETERDIR}/sczbt_${RS} <<EOF
#!/usr/bin/ksh
#
! # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Parameters for sczbt (Zone Boot)
#
# Zonename Name of the zone
# Zonebrand Brand of the zone. Current supported options are
! # "native" (default), "lx" or "solaris8"
# Zonebootopt Zone boot options ("-s" requires that Milestone=single-user)
# Milestone SMF Milestone which needs to be online before the zone is
# considered as booted. This option is only used for the
# "native" Zonebrand.
# LXrunlevel Runlevel which needs to get reached before the zone is
# considered booted. This option is only used for the "lx"
# Zonebrand.
# SLrunlevel Solaris legacy runlevel which needs to get reached before the
# zone is considered booted. This option is only used for the
! # "solaris8" Zonebrand.
# Mounts Mounts is a list of directories and their mount options,
# which are loopback mounted from the global zone into the
# newly booted zone. The mountpoint in the local zone can
# be different to the mountpoint from the global zone.
#
--- 62,93 ----
echo "The value given for PARAMETERDIR (${PARAMETERDIR}) in sczbt_config is not a directory!"
exit 1
fi
if [ ! -f ${PARAMETERDIR}/sczbt_${RS} ]; then
! /bin/cat > ${PARAMETERDIR}/sczbt_${RS} <<EOF
#!/usr/bin/ksh
#
! # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Parameters for sczbt (Zone Boot)
#
# Zonename Name of the zone
# Zonebrand Brand of the zone. Current supported options are
! # "native" (default), "lx", "solaris8" or "solaris9"
# Zonebootopt Zone boot options ("-s" requires that Milestone=single-user)
# Milestone SMF Milestone which needs to be online before the zone is
# considered as booted. This option is only used for the
# "native" Zonebrand.
# LXrunlevel Runlevel which needs to get reached before the zone is
# considered booted. This option is only used for the "lx"
# Zonebrand.
# SLrunlevel Solaris legacy runlevel which needs to get reached before the
# zone is considered booted. This option is only used for the
! # "solaris8" or "solaris9" Zonebrand.
# Mounts Mounts is a list of directories and their mount options,
# which are loopback mounted from the global zone into the
# newly booted zone. The mountpoint in the local zone can
# be different to the mountpoint from the global zone.
#
*** 133,143 ****
SC_NETWORK=`echo ${SC_NETWORK} | /usr/xpg4/bin/tr [:upper:] [:lower:]`
if [ "${SC_NETWORK}" == "true" -a -z "${SC_LH}" ]
then
echo "Error: SC_LH is required with SC_NETWORK=true"
! rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
fi
# If the configured zone has set ip-type=exclusive, then assigning a
# SUNW.LogicalHostname to this zone is not possible.
--- 133,143 ----
SC_NETWORK=`echo ${SC_NETWORK} | /usr/xpg4/bin/tr [:upper:] [:lower:]`
if [ "${SC_NETWORK}" == "true" -a -z "${SC_LH}" ]
then
echo "Error: SC_LH is required with SC_NETWORK=true"
! /bin/rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
fi
# If the configured zone has set ip-type=exclusive, then assigning a
# SUNW.LogicalHostname to this zone is not possible.
*** 145,155 ****
IPTYPE=`/usr/sbin/zonecfg -z ${Zonename} info | /bin/grep "^ip-type:" | /bin/awk '{print $2}'`
if [ "${IPTYPE}" == "exclusive" ] && [ "${SC_NETWORK}" == "true" ]
then
echo "Error: The zone ${Zonename} has set ip-type=exclusive. This can not be combined with setting SC_NETWORK=true."
! rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
fi
# Checking dependencies for FAILOVER=true
--- 145,155 ----
IPTYPE=`/usr/sbin/zonecfg -z ${Zonename} info | /bin/grep "^ip-type:" | /bin/awk '{print $2}'`
if [ "${IPTYPE}" == "exclusive" ] && [ "${SC_NETWORK}" == "true" ]
then
echo "Error: The zone ${Zonename} has set ip-type=exclusive. This can not be combined with setting SC_NETWORK=true."
! /bin/rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
fi
# Checking dependencies for FAILOVER=true
*** 156,166 ****
FAILOVER=`echo ${FAILOVER} | /usr/xpg4/bin/tr [:upper:] [:lower:]`
if [ "${FAILOVER}" == "true" -a -z "${HAS_RS}" ]
then
echo "Error: HAS_RS is required with FAILOVER=true"
! rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
fi
# Setting Resource_dependencies
--- 156,166 ----
FAILOVER=`echo ${FAILOVER} | /usr/xpg4/bin/tr [:upper:] [:lower:]`
if [ "${FAILOVER}" == "true" -a -z "${HAS_RS}" ]
then
echo "Error: HAS_RS is required with FAILOVER=true"
! /bin/rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
fi
# Setting Resource_dependencies
*** 210,220 ****
St=$?
if [ "${St}" -ne 0 ]; then
echo "Registration of resource ${RS} failed, please correct the wrong parameters."
echo "Removing parameterfile ${PARAMETERDIR}/sczbt_${RS} for resource ${RS}."
! rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
else
echo "Registration of resource ${RS} succeeded."
fi
--- 210,220 ----
St=$?
if [ "${St}" -ne 0 ]; then
echo "Registration of resource ${RS} failed, please correct the wrong parameters."
echo "Removing parameterfile ${PARAMETERDIR}/sczbt_${RS} for resource ${RS}."
! /bin/rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
else
echo "Registration of resource ${RS} succeeded."
fi
*** 228,238 ****
echo "Validation of resource ${RS} failed, check the syslog for the wrong parameters."
echo "Removing resource ${RS} from the cluster configuration."
/usr/cluster/bin/scrgadm -r -j ${RS}
echo "Removing parameterfile ${PARAMETERDIR}/sczbt_${RS} for resource ${RS}."
! rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
else
echo "Validation of resource ${RS} succeeded."
fi
--- 228,238 ----
echo "Validation of resource ${RS} failed, check the syslog for the wrong parameters."
echo "Removing resource ${RS} from the cluster configuration."
/usr/cluster/bin/scrgadm -r -j ${RS}
echo "Removing parameterfile ${PARAMETERDIR}/sczbt_${RS} for resource ${RS}."
! /bin/rm ${PARAMETERDIR}/sczbt_${RS}
exit 1
else
echo "Validation of resource ${RS} succeeded."
fi