Cdiff ids_register.ksh
*** /workspace/neilga/ohacds-ids/webrev/usr/src/cmd/ha-services/gds-agents/ids/ids_register.ksh- Thu Apr 24 01:39:30 2008
--- ids_register.ksh Thu Apr 24 01:37:31 2008
*** 42,51 ****
--- 42,62 ----
[ -z "${MYCONFIG}" ] && MYCONFIG=/opt/SUNWscids/util/ids_config
. ${MYCONFIG}
+ for i in RS RG USERID INFORMIXDIR ONCONFIG INFORMIXSERVER INFORMIXSQLHOSTS
+ do
+ if eval [ -z \$$i ]
+ then
+ /usr/bin/printf "ids requires a value for $i= within ${MYCONFIG}\n"
+ rc=1
+ fi
+ done
+
+ [ "${rc}" -ne 0 ] && exit 1
+
if [ -z ${RS_ZONE} ]
then
/usr/cluster/bin/clrs create -g ${RG} -t SUNW.gds \
-p Start_command="/opt/SUNWscids/bin/control_ids \
*** 106,115 ****
--- 117,137 ----
exit 1
else
ZONE=`/usr/bin/grep Zonename= ${ZONEPFILE}/sczbt_${RS_ZONE} | /usr/bin/awk -F= '{print $2}' | /usr/xpg4/bin/tr -d '"' `
fi
+ # VALIDATE RESOURCE
+
+ if /usr/sbin/zlogin ${ZONE} "/opt/SUNWscids/bin/control_ids -R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' -S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' validate ids "
+ then
+ /usr/bin/printf "Validation of ${RS} succeeded\n"
+ else
+ /usr/bin/printf "Validation of ${RS} failed\n"
+ /usr/bin/printf "Check the syslog for ${ZONE}\n"
+ exit 1
+ fi
+
SERVICE_TAG=svc:/application/sczone-agents:${RS}
/usr/bin/cat > /var/tmp/${RS}_smf_config <<-EOF
RS=${RS}
RG=${RG}
*** 131,140 ****
--- 153,172 ----
if /usr/sbin/zlogin ${ZONE} ${IDSDIR}/util/ids_smf_register ${TMP_WORK_CONFIG}
then
if /opt/SUNWsczone/sczsmf/util/sczsmf_register -f /var/tmp/${RS}_smf_config
then
/usr/bin/printf "Registration of ${RS} succeeded\n"
+
+ if ! /usr/cluster/bin/clrs set -p Start_timeout=${START_TIMEOUT} ${RS}
+ then
+ /usr/bin/printf "clrs set -p Start_timeout=${START_TIMEOUT} ${RS} failed\n"
+ fi
+
+ if ! /usr/cluster/bin/clrs set -p Stop_timeout=${STOP_TIMEOUT} ${RS}
+ then
+ /usr/bin/printf "clrs set -p Stop_timeout=${STOP_TIMEOUT} ${RS} failed\n"
+ fi
else
/usr/bin/printf "Registration of ${RS} failed\n"
exit 1
fi
fi