Cdiff functions.ksh
*** /workspace/tf84964/oscds-6662001-6610950/webrev/usr/src/cmd/ha-services/gds-agents/zone/sczbt/functions.ksh-        Wed Apr  2 07:44:01 2008
--- functions.ksh       Wed Apr  2 07:38:45 2008

*** 18,28 **** # # CDDL HEADER END # # ! # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" # --- 18,28 ---- # # CDDL HEADER END # # ! # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" #
*** 106,116 **** # test the semantic of the parameters . ${PARFILE} ! for i in `cat ${PARFILE} |grep -v "^#"|grep -v "^ "|nawk -F= '{print $1}'` do case ${i} in Zonename) --- 106,116 ---- # test the semantic of the parameters . ${PARFILE} ! for i in `/bin/cat ${PARFILE} | /bin/grep -v "^#"| /bin/grep -v "^ "| /bin/nawk -F= '{print $1}'` do case ${i} in Zonename)
*** 158,168 **** rc_validate=1 fi # is the autobooot set to false ! if ! ${ZONECFG} -z ${Zonename} info |grep autoboot|grep false >/dev/null 2>&1 then # SCMSGS # @explanation # The referenced zone is configured with # autoboot = true. This option needs to be --- 158,168 ---- rc_validate=1 fi # is the autobooot set to false ! if ! ${ZONECFG} -z ${Zonename} info | /bin/grep autoboot| /bin/grep false >/dev/null 2>&1 then # SCMSGS # @explanation # The referenced zone is configured with # autoboot = true. This option needs to be
*** 492,502 **** echo info net | ${ZONECFG} -z ${Zonename} > ${ZONE_NET_INFO} for j in ${IPMP_HOST_IP} do ! for i in `grep address ${ZONE_NET_INFO} | awk '{print $2}' | awk -F/ '{print $1}'` do if [ "${i}" = "${j}" ] then # SCMSGS # @explanation --- 492,502 ---- echo info net | ${ZONECFG} -z ${Zonename} > ${ZONE_NET_INFO} for j in ${IPMP_HOST_IP} do ! for i in `/bin/grep address ${ZONE_NET_INFO} | /bin/awk '{print $2}' | /bin/awk -F/ '{print $1}'` do if [ "${i}" = "${j}" ] then # SCMSGS # @explanation
*** 517,527 **** # Test if the IPMP_HOST has been configured within the Zone for j in ${IPMP_HOST} do ! for i in `grep address ${ZONE_NET_INFO} | awk '{print $2}' | awk -F/ '{print $1}'` do if [ "${i}" = "${j}" ] then scds_syslog -p daemon.err -t $(syslog_tag) -m \ "Function: validate - %s configured with address %s, please remove the address using zonecfg" \ --- 517,527 ---- # Test if the IPMP_HOST has been configured within the Zone for j in ${IPMP_HOST} do ! for i in `/bin/grep address ${ZONE_NET_INFO} | /bin/awk '{print $2}' | /bin/awk -F/ '{print $1}'` do if [ "${i}" = "${j}" ] then scds_syslog -p daemon.err -t $(syslog_tag) -m \ "Function: validate - %s configured with address %s, please remove the address using zonecfg" \
*** 533,553 **** # Test if another zone is already using this IPMP_HOST_IP for ADAPTER in ${ADAPTER_LIST} do ! for i in `${IFCONFIG} -a | grep ${ADAPTER} | awk -F: '{print $2}' | grep -v flags` do ! IPMP_ADAPTER_IP=`${IFCONFIG} ${ADAPTER}:${i} | grep -w inet | awk '{print $2}'` for j in ${IPMP_HOST_IP} do if [ "${IPMP_ADAPTER_IP}" = "${j}" ] then ! if ${IFCONFIG} ${ADAPTER}:${i} | grep -w zone > /dev/null then ! ZONE_ADAPTER=`${IFCONFIG} ${ADAPTER}:${i} | grep -w zone | awk '{print $2}'` # SCMSGS # @explanation # The logical host is # used in another zone --- 533,553 ---- # Test if another zone is already using this IPMP_HOST_IP for ADAPTER in ${ADAPTER_LIST} do ! for i in `${IFCONFIG} -a | /bin/grep ${ADAPTER} | /bin/awk -F: '{print $2}' | /bin/grep -v flags` do ! IPMP_ADAPTER_IP=`${IFCONFIG} ${ADAPTER}:${i} | /bin/grep -w inet | /bin/awk '{print $2}'` for j in ${IPMP_HOST_IP} do if [ "${IPMP_ADAPTER_IP}" = "${j}" ] then ! if ${IFCONFIG} ${ADAPTER}:${i} | /bin/grep -w zone > /dev/null then ! ZONE_ADAPTER=`${IFCONFIG} ${ADAPTER}:${i} | /bin/grep -w zone | /bin/awk '{print $2}'` # SCMSGS # @explanation # The logical host is # used in another zone
*** 575,585 **** if [ "${Zonebootopt}" = "-s" ] then case ${Zonebrand} in native) ! if ! echo ${Milestone} | grep single-user > /dev/null then # SCMSGS # @explanation # The Zoneboot variable is set to -s. Every # milestone other than single-user is invalid. --- 575,585 ---- if [ "${Zonebootopt}" = "-s" ] then case ${Zonebrand} in native) ! if ! echo ${Milestone} | /bin/grep single-user > /dev/null then # SCMSGS # @explanation # The Zoneboot variable is set to -s. Every # milestone other than single-user is invalid.
*** 632,647 **** esac fi # Check that lofs is not excluded, first check if an exclude lofs in in /etc/system ! if grep -w exclude /etc/system |grep lofs >/dev/null 2>&1 then # if yes check if it is commented out ! if ! grep -w exclude /etc/system |grep lofs |egrep "^\*|^ +\*|^#|^ +| +#|^ +\*" >/dev/null 2>&1 then # SCMSGS # @explanation # The kernel module for the lofs filesystem is still # excluded in /etc/system. --- 632,647 ---- esac fi # Check that lofs is not excluded, first check if an exclude lofs in in /etc/system ! if /bin/grep -w exclude /etc/system | /bin/grep lofs >/dev/null 2>&1 then # if yes check if it is commented out ! if ! /bin/grep -w exclude /etc/system |/bin/grep lofs | /bin/egrep "^\*|^ +\*|^#|^ +| +#|^ +\*" >/dev/null 2>&1 then # SCMSGS # @explanation # The kernel module for the lofs filesystem is still # excluded in /etc/system.
*** 663,682 **** for i in ${Mounts} do directory= localdir= ! if echo ${i} | grep : >/dev/null 2>&1 then ! echo ${i} | awk -F: '{ print NF,$1,$2 }' | read field_count val1 val2 case ${field_count} in 2) # Support <global zone directory>:<local zone directory> # Support <global zone directory>:<mount options> directory=${val1} ! if echo ${val2} | grep / > /dev/null 2>&1 then localdir=${Zonepath}/root${val2} else localdir=${Zonepath}/root${val1} fi --- 663,682 ---- for i in ${Mounts} do directory= localdir= ! if echo ${i} | /bin/grep : >/dev/null 2>&1 then ! echo ${i} | /bin/awk -F: '{ print NF,$1,$2 }' | read field_count val1 val2 case ${field_count} in 2) # Support <global zone directory>:<local zone directory> # Support <global zone directory>:<mount options> directory=${val1} ! if echo ${val2} | /bin/grep / > /dev/null 2>&1 then localdir=${Zonepath}/root${val2} else localdir=${Zonepath}/root${val1} fi
*** 764,783 **** do source= target= mountopt= ! if echo ${i} | grep : >/dev/null 2>&1 then ! echo ${i} | awk -F: '{ print NF,$1,$2,$3 }' | read field_count val1 val2 val3 case ${field_count} in 2) # Support <global zone directory>:<local zone directory> # Support <global zone directory>:<mount options> source=${val1} ! if echo ${val2} | grep / > /dev/null 2>&1 then target=${Zonepath}/root${val2} else target=${Zonepath}/root${val1} [ ${val2} ] && mountopt="-o ${val2}" --- 764,783 ---- do source= target= mountopt= ! if echo ${i} | /bin/grep : >/dev/null 2>&1 then ! echo ${i} | /bin/awk -F: '{ print NF,$1,$2,$3 }' | read field_count val1 val2 val3 case ${field_count} in 2) # Support <global zone directory>:<local zone directory> # Support <global zone directory>:<mount options> source=${val1} ! if echo ${val2} | /bin/grep / > /dev/null 2>&1 then target=${Zonepath}/root${val2} else target=${Zonepath}/root${val1} [ ${val2} ] && mountopt="-o ${val2}"
*** 836,846 **** { debug_message "Function: get_zonepath - Begin" ${SET_DEBUG} myzone=${1} ! Zonepath=`${ZONECFG} -z ${myzone} info|grep ^zonepath:|awk '{print $2}'` debug_message "Function: zonepath - End" } get_ipmp_hosts() --- 836,846 ---- { debug_message "Function: get_zonepath - Begin" ${SET_DEBUG} myzone=${1} ! Zonepath=`${ZONECFG} -z ${myzone} info | /bin/grep ^zonepath: | /bin/awk '{print $2}'` debug_message "Function: zonepath - End" } get_ipmp_hosts()
*** 848,859 **** debug_message "Function: get_ipmp_hosts - Begin" ${SET_DEBUG} LH=$1 ! IPMP_HOST=`${SCHA_RESOURCE_GET} -O Extension -R ${LH} -G ${RESOURCEGROUP} HostnameList |tail +2` ! IPMP_HOST_IP=`getent hosts ${IPMP_HOST} | awk '{print $1}'` debug_message "Function: get_ipmp_hosts - End" } get_ipmp_state() --- 848,859 ---- debug_message "Function: get_ipmp_hosts - Begin" ${SET_DEBUG} LH=$1 ! IPMP_HOST=`${SCHA_RESOURCE_GET} -O Extension -R ${LH} -G ${RESOURCEGROUP} HostnameList | /bin/tail +2` ! IPMP_HOST_IP=`/bin/getent hosts ${IPMP_HOST} | /bin/awk '{print $1}'` debug_message "Function: get_ipmp_hosts - End" } get_ipmp_state()
*** 869,894 **** NODEID=`${CLINFO} -n` # Get the correct IPMP group, i.e. <IPMP>@${NODEID} ! IPMP_LIST=`${SCHA_RESOURCE_GET} -O Extension -R ${LH} -G ${RESOURCEGROUP} NetIfList |tail +2` for i in ${IPMP_LIST} do ! if [ `echo ${i} | awk -F@ '{print $2}'` -eq "${NODEID}" ] then ! IPMP_GROUP=`echo ${i} | awk -F@ '{print $1}'` fi done # Get the Online IPMP adapter list for that IPMP Group LOCALNODENAME=`${SCHA_CLUSTER_GET} -O NODENAME_LOCAL` ! ADAPTER_LIST=`${SCSTAT} -i -h ${LOCALNODENAME} | grep " ${IPMP_GROUP} " | \ ! grep Online | awk '{print $6}'` debug_message "Function: get_ipmp_state - End" } start_sczbt() --- 869,893 ---- NODEID=`${CLINFO} -n` # Get the correct IPMP group, i.e. <IPMP>@${NODEID} ! IPMP_LIST=`${SCHA_RESOURCE_GET} -O Extension -R ${LH} -G ${RESOURCEGROUP} NetIfList | /bin/tail +2` for i in ${IPMP_LIST} do ! if [ `echo ${i} | /bin/awk -F@ '{print $2}'` -eq "${NODEID}" ] then ! IPMP_GROUP=`echo ${i} | /bin/awk -F@ '{print $1}'` fi done # Get the Online IPMP adapter list for that IPMP Group LOCALNODENAME=`${SCHA_CLUSTER_GET} -O NODENAME_LOCAL` ! ADAPTER_LIST=`/bin/env LC_ALL=POSIX ${SCSTAT} -i -h ${LOCALNODENAME} | /bin/grep " ${IPMP_GROUP} " | /bin/grep Online | /bin/awk '{print $6}'` debug_message "Function: get_ipmp_state - End" } start_sczbt()
*** 995,1007 **** for ADAPTER in ${ADAPTER_LIST} do for j in ${IPMP_HOST_IP} do ! for i in `${IFCONFIG} -a | grep ${ADAPTER} | awk -F: '{print $2}' | grep -v flags` do ! IPMP_ADAPTER_IP=`${IFCONFIG} ${ADAPTER}:${i} | grep -w inet | awk '{print $2}'` if [ "${IPMP_ADAPTER_IP}" = "${j}" ] then if ! ${IFCONFIG} ${ADAPTER}:${i} zone ${Zonename} then --- 994,1006 ---- for ADAPTER in ${ADAPTER_LIST} do for j in ${IPMP_HOST_IP} do ! for i in `${IFCONFIG} -a | /bin/grep ${ADAPTER} | /bin/awk -F: '{print $2}' | /bin/grep -v flags` do ! IPMP_ADAPTER_IP=`${IFCONFIG} ${ADAPTER}:${i} | /bin/grep -w inet | /bin/awk '{print $2}'` if [ "${IPMP_ADAPTER_IP}" = "${j}" ] then if ! ${IFCONFIG} ${ADAPTER}:${i} zone ${Zonename} then
*** 1066,1088 **** for ADAPTER in ${ADAPTER_LIST} do for j in ${IPMP_HOST_IP} do ! for i in `${IFCONFIG} -a | grep ${ADAPTER} | awk -F: '{print $2}' | grep -v flags` do # For each ${ADAPTER}:${i} check "${IPMP_ADAPTER_IP}" = "${j}" , ${j} is one of the list of ip addresses # If there's a match, then for each ${ADAPTER}:${i} check the zone flag = "${Zonename}" # If there's a match then place the ${ADAPTER}:${i} back into the global zone ! IPMP_ADAPTER_IP=`${IFCONFIG} ${ADAPTER}:${i} | grep -w inet | awk '{print $2}'` if [ "${IPMP_ADAPTER_IP}" = "${j}" ] then ! if ${IFCONFIG} ${ADAPTER}:${i} | grep -w zone > /dev/null then ! ZONE_ADAPTER=`${IFCONFIG} ${ADAPTER}:${i} | grep -w zone | awk '{print $2}'` if [ "${ZONE_ADAPTER}" = "${Zonename}" ] then ${IFCONFIG} ${ADAPTER}:${i} -zone --- 1065,1087 ---- for ADAPTER in ${ADAPTER_LIST} do for j in ${IPMP_HOST_IP} do ! for i in `${IFCONFIG} -a | /bin/grep ${ADAPTER} | /bin/awk -F: '{print $2}' | /bin/grep -v flags` do # For each ${ADAPTER}:${i} check "${IPMP_ADAPTER_IP}" = "${j}" , ${j} is one of the list of ip addresses # If there's a match, then for each ${ADAPTER}:${i} check the zone flag = "${Zonename}" # If there's a match then place the ${ADAPTER}:${i} back into the global zone ! IPMP_ADAPTER_IP=`${IFCONFIG} ${ADAPTER}:${i} | /bin/grep -w inet | /bin/awk '{print $2}'` if [ "${IPMP_ADAPTER_IP}" = "${j}" ] then ! if ${IFCONFIG} ${ADAPTER}:${i} | /bin/grep -w zone > /dev/null then ! ZONE_ADAPTER=`${IFCONFIG} ${ADAPTER}:${i} | /bin/grep -w zone | /bin/awk '{print $2}'` if [ "${ZONE_ADAPTER}" = "${Zonename}" ] then ${IFCONFIG} ${ADAPTER}:${i} -zone
*** 1267,1277 **** if /bin/pgrep -z global -f "gds_svc_start .*-R ${RESOURCE} " >/dev/null 2>&1 then # check if the scheduler is running ! if ! pgrep -z ${Zonename} zsched>/dev/null 2>&1 then rc_check_sczbt=100 debug_message "Function: check_sczbt - Early end" return ${rc_check_sczbt} fi --- 1266,1276 ---- if /bin/pgrep -z global -f "gds_svc_start .*-R ${RESOURCE} " >/dev/null 2>&1 then # check if the scheduler is running ! if ! /bin/pgrep -z ${Zonename} zsched>/dev/null 2>&1 then rc_check_sczbt=100 debug_message "Function: check_sczbt - Early end" return ${rc_check_sczbt} fi
*** 1321,1331 **** else # check if the scheduler is running ! if ! pgrep -z ${Zonename} zsched>/dev/null 2>&1 then # SCMSGS # @explanation # The zsched prcess of the referenced zone is not # running. The zone is not operable. --- 1320,1330 ---- else # check if the scheduler is running ! if ! /bin/pgrep -z ${Zonename} zsched>/dev/null 2>&1 then # SCMSGS # @explanation # The zsched prcess of the referenced zone is not # running. The zone is not operable.
*** 1353,1363 **** do get_ipmp_hosts ${LH} for i in ${IPMP_HOST_IP} do ! if ! echo ${ip_config} |grep -w ${i}>/dev/null 2>&1 then # SCMSGS # @explanation # The referenced zones ip # address is unplumbed. --- 1352,1362 ---- do get_ipmp_hosts ${LH} for i in ${IPMP_HOST_IP} do ! if ! echo ${ip_config} | /bin/grep -w ${i} >/dev/null 2>&1 then # SCMSGS # @explanation # The referenced zones ip # address is unplumbed.