--- old/usr/src/cmd/ha-services/gds-agents/Makefile Tue Jan 22 20:55:27 2008 +++ new/usr/src/cmd/ha-services/gds-agents/Makefile Tue Jan 22 20:55:27 2008 @@ -34,6 +34,7 @@ 9ias \ dhc \ ebs \ + ids \ mys \ pax \ PostgreSQL \ @@ -43,7 +44,7 @@ smb \ sps \ tomcat \ - zone + zone # Assume open source developers don't have access to the IBM WebSphere MQ # development repository "$(EXTERNAL_PKGS)/MQ" --- /dev/null Tue Jan 22 20:55:27 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/Makefile Tue Jan 22 20:55:27 2008 @@ -0,0 +1,73 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# usr/src/cmd/ha-services/gds-agents/ids/Makefile +# + +# list common shell scripts for $(PKGNAME)/bin +KSH_BIN_SRCS = control_ids.ksh \ + functions.ksh + +# list config file for $(PKGNAME)/etc +CONF = config + +# list common util shell scripts for $(PKGNAME)/util +KSH_UTIL_SRCS = ids_register.ksh \ + ids_smf_register.ksh \ + ids_smf_remove.ksh + +# list common util config files for $(PKGNAME)/util +UTIL_CONF = ids_config + +PROG = $(KSH_BIN_SRCS:%.ksh=%) + +UTILPROG = $(KSH_UTIL_SRCS:%.ksh=%) $(UTIL_CONF) + +include $(SRC)/cmd/Makefile.cmd + +# Packaging +PKGNAME = SUNWscids +RTRFILE = SUNW.ids + +# Disable I18N stuff, the po filename needs to be unique to support parallel +# builds of the agents below gds-agents +POFILE= $(PKGNAME).po +PIFILES= + +# Disable lint +LINTFILES= + +.KEEP_STATE: + +all: $(PROG) $(UTILPROG) + +.PARALLEL: $(PROG) $(UTILPROG) + +install: all $(ROOTOPTBINPROG) $(ROOTOPTETCRTR) $(ROOTOPTETCCONF) $(ROOTOPTUTILPROG) + +clean: + $(RM) $(PROG) $(KSH_UTIL_SRCS:%.ksh=%) + +include $(SRC)/cmd/Makefile.targ --- /dev/null Tue Jan 22 20:55:28 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/functions.ksh Tue Jan 22 20:55:28 2008 @@ -0,0 +1,759 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# + +PKG=SUNWscids +LOGFILE=/var/tmp/${RESOURCE}_logfile +TASK_COMMAND="" +RESOURCE_PROJECT_NAME="" +SCLOGGER=/usr/cluster/lib/sc/scds_syslog +LOGGER=/usr/bin/logger + +syslog_tag() +{ + ${SET_DEBUG} + print "SC[${PKG:-??}.${COMPONENT:-??}.${METHOD:-??}]:${RESOURCEGROUP:-??}:${RESOURCE:-??}" +} + +scds_syslog() +{ + if [ -f "${SCLOGGER}" ] + then + ${SCLOGGER} "$@" & + else + while getopts 'p:t:m' opt + do + case "${opt}" in + t) TAG=${OPTARG};; + p) PRI=${OPTARG};; + esac + done + + shift $((${OPTIND} - 1)) + LOG_STRING=`/usr/bin/printf "$@"` + ${LOGGER} -p ${PRI} -t ${TAG} ${LOG_STRING} + fi +} + +debug_message() +{ + if [ "${DEBUG}" = "${RESOURCE}" -o "${DEBUG}" = "ALL" ] + then + SET_DEBUG="set -x" + DEBUG_TEXT=${1} + + scds_syslog -p daemon.debug -t $(syslog_tag) -m \ + "%s" "${DEBUG_TEXT}" + else + SET_DEBUG= + fi +} + +log_message() +{ + debug_message "Function: log_message - Begin" + {SET_DEBUG} + + if [ -s "${LOGFILE}" ] + then + PRIORITY=$1 + HEADER=$2 + + strings ${LOGFILE} > ${LOGFILE}.copy + + while read MSG_TXT + do + scds_syslog -p daemon.${PRIORITY} -t $(syslog_tag) -m \ + "%s - %s" \ + "${HEADER}" "${MSG_TXT}" + done < ${LOGFILE}.copy + + cat /dev/null > ${LOGFILE} + fi + + debug_message "Function: log_message - End" +} + +set_redirection() +{ + debug_message "Function: set_redirection - Begin" + ${SET_DEBUG} + + if /usr/bin/getent passwd ${USERID} | /usr/bin/awk -F: '{print $7}' | /usr/bin/grep csh > /dev/null + then + OUTPUT=">& ${LOGFILE}" + else + OUTPUT="> ${LOGFILE} 2>&1" + fi + + debug_message "Function: set_redirection - End" +} + +validate() +{ + debug_message "Function: validate - Begin" + ${SET_DEBUG} + + rc=0 + + # Note that group/user informix is an IDS requirement. Refer to + # http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic + # and in particular Installing IDS. + + if /usr/bin/getent passwd informix > /dev/null + then + debug_message "Validate - User informix exists" + else + # SCMSGS + # @explanation + # The userid informix does not exist. + # @user_action + # You must create the userid informix. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - User informix does not exist" + rc=1 + fi + + if /usr/bin/getent group informix > /dev/null + then + debug_message "Validate - Group informix exists" + else + # SCMSGS + # @explanation + # The group informix does not exist. + # @user_action + # You must create the group informix. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - Group informix does not exist" + rc=1 + fi + + if [ "${USERID}" = "informix" ] + then + debug_message "Validate - Userid is informix" + else + pgroup=`/usr/bin/getent passwd ${USERID} | /usr/bin/awk -F: '{print $4}'` + + if [ -n "${pgroup}" ] + then + if /usr/bin/getent group ${pgroup} | /usr/bin/awk -F: '{ if ($1 == "informix") print $3}' | \ + /usr/bin/grep "^${pgroup}$" > /dev/null + then + debug_message "Validate - Primary group for userid ${USERID} is informix" + else + if /usr/bin/getent group informix | /usr/bin/awk -F: '{print $4}' | \ + /usr/bin/grep ${USERID} > /dev/null + then + debug_message "Validate - Secondary group for userid ${USERID} is informix" + else + # SCMSGS + # @explanation + # The user is not a member of the group informix. + # @user_action + # Ensure the user is a member of the group informix. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - Userid %s is not a member of group informix" \ + "${USERID}" + rc=1 + fi + fi + else + # SCMSGS + # @explanation + # The user is not a valid userid. + # @user_action + # Ensure the user name is correct. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - User %s is not a valid userid" \ + "${USERID}" + rc=1 + fi + fi + + if [ -d "${INFORMIXDIR}" ] + then + debug_message "Validate - ${INFORMIXDIR} exists" + + if [ -x "${INFORMIXDIR}/bin/oninit" ] + then + debug_message "Validate - ${INFORMIXDIR}/bin/oninit exists and is executable" + else + # SCMSGS + # @explanation + # oninit was not found in ${INFORMIXDIR}/bin. + # @user_action + # Ensure that ${INFORMIXDIR} is the directory path + # where the Informix files are installed. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - %s/bin/oninit does not exist" \ + "${INFORMIXDIR}" + rc=1 + fi + else + # SCMSGS + # @explanation + # ${INFORMIXDIR} does not exist or is not a directory. + # @user_action + # Ensure that ${INFORMIXDIR} is the directory path + # where the Informix files are installed. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - %s does not exist or is not a directory" \ + "${INFORMIXDIR}" + rc=1 + fi + + # Here, we check that the ${ONCONFIG} file contains + # the ROOTNAME variable, below is snipped sample + # ${ONCONFIG} file containing ROOTNAME. + # + # ROOTNAME rootdbs # Root dbspace name + + if [ -f "${INFORMIXDIR}/etc/${ONCONFIG}" ] + then + debug_message "Validate - ${INFORMIXDIR}/etc/${ONCONFIG} exists" + + if /usr/xpg4/bin/grep -qw ROOTNAME ${INFORMIXDIR}/etc/${ONCONFIG} + then + debug_message "Validate - ROOTNAME found in ${INFORMIXDIR}/etc/${ONCONFIG}" + else + # SCMSGS + # @explanation + # ${INFORMIXDIR}/bin/${ONCONFIG} is not a valid onconfig file. + # @user_action + # Ensure that ${INFORMIXDIR}/etc/${ONCONFIG} is a valid onconfig file. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - %s/bin/%s is not a valid onconfig file" \ + "${INFORMIXDIR}" "${ONCONFIG}" + rc=1 + fi + + # Here, we check that the ${ONCONFIG} file contains + # the ${INFORMIXSERVER} name, below is snipped sample + # ${ONCONFIG} file containing ${INFORMIXSERVER}. + # + # DBSERVERNAME demo_on + # + # Note that ${INFORMIXSERVER} is represented by "demo_on". + + if /usr/xpg4/bin/grep -qw ${INFORMIXSERVER} ${INFORMIXDIR}/etc/${ONCONFIG} + then + debug_message "Validate - ${INFORMIXSERVER} found in ${INFORMIXDIR}/etc/${ONCONFIG}" + else + # SCMSGS + # @explanation + # ${INFORMIXDIR}/etc/${ONCONFIG} does not contain ${INFORMIXSERVER}. + # @user_action + # Ensure that ${INFORMIXDIR}/etc/${ONCONFIG} contains ${INFORMIXSERVER}. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - %s/etc/%s does not contain %s" \ + "${INFORMIXDIR}" "${ONCONFIG}" "${INFORMIXSERVER}" + rc=1 + fi + else + # SCMSGS + # @explanation + # ${INFORMIXDIR}/etc/${ONCONFIG} does not exist. + # @user_action + # Ensure that ${INFORMIXDIR}/etc/${ONCONFIG} exists. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - %s/etc/%s does not exist" \ + "${INFORMIXDIR}" "${ONCONFIG}" + rc=1 + fi + + # Here, we check that the ${INFORMIXSQLHOSTS} file contains + # the ${INFORMIXSERVER} name, below is snipped sample + # ${INFORMIXSQLHOSTS} file containing ${INFORMIXSERVER}. + # + # demo_on ontlitcp lzmutt1a 9088 + # + # Note that ${INFORMIXSERVER} is represented by "demo_on". + + if [ -f "${INFORMIXSQLHOSTS}" ] + then + debug_message "Validate - ${INFORMIXSQLHOSTS} exists" + + if /usr/xpg4/bin/grep -qw ${INFORMIXSERVER} ${INFORMIXSQLHOSTS} + then + debug_message "Validate - ${INFORMIXSERVER} found in ${INFORMIXSQLHOSTS}" + else + # SCMSGS + # @explanation + # ${INFORMIXSQLHOSTS} does not contain ${INFORMIXSERVER}. + # @user_action + # Ensure that ${INFORMIXSQLHOSTS} is contains ${INFORMIXSERVER}. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - %s does not contain %s" \ + "${INFORMIXSQLHOSTS}" "${INFORMIXSERVER}" + rc=1 + fi + else + # SCMSGS + # @explanation + # ${INFORMIXSQLHOSTS does not exist. + # @user_action + # Ensure that ${INFORMIXSQLHOSTS} exists. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Validate - %s does not exist" \ + "${INFORMIXSQLHOSTS}" + rc=1 + fi + + if [ "${rc}" -eq 0 ] + then + # SCMSGS + # @explanation + # The Informix Server validation was successful. + # @user_action + # None required, informational message. + scds_syslog -p daemon.info -t $(syslog_tag) -m \ + "Validate - Informix Server (%s) validation was successful" \ + "${INFORMIXSERVER}" + fi + + debug_message "Function: validate - End" + return ${rc} +} + +start_ids() +{ + debug_message "Function: start_ids - Begin" + ${SET_DEBUG} + + /usr/bin/rm ${LOGFILE} > /dev/null + + if [ "${CALLER}" = "GDS" ] + then + get_state + check_ids debug + rc=$? + + # Check_ids will return 0 if + # - The Informix Server is running + # - No blocked on "MEDIA FAILURE" or "HANG_SYSTEM" exists + + if [ "${rc}" -eq 0 ] + then + # Turn off PMF restart if ${INFORMIXSERVER} has been manually started + /usr/bin/sleep ${START_TIMEOUT} & + /usr/cluster/bin/pmfadm -s ${RESOURCEGROUP},${RESOURCE},0.svc + + # SCMSGS + # @explanation + # The specified Informix Server has been manually started. + # @user_action + # None required. Informational message. + scds_syslog -p daemon.notice -t $(syslog_tag) -m \ + "start_ids - Informix Server (%s) was manually started" \ + "${INFORMIXSERVER}" + + return 0 + fi + + /usr/bin/su ${USERID} -c "${TASK_COMMAND} env INFORMIXDIR=${INFORMIXDIR} INFORMIXSERVER=${INFORMIXSERVER} INFORMIXSQLHOSTS=${INFORMIXSQLHOSTS} ONCONFIG=${ONCONFIG} ${INFORMIXDIR}/bin/oninit -y ${OUTPUT} &" > /dev/null + + else + env INFORMIXDIR=${INFORMIXDIR} INFORMIXSERVER=${INFORMIXSERVER} INFORMIXSQLHOSTS=${INFORMIXSQLHOSTS} ONCONFIG=${ONCONFIG} ${INFORMIXDIR}/bin/oninit -y > ${LOGFILE} 2>&1 & + + fi + + rc=$? + + if [ "${rc}" -eq 0 ] + then + # SCMSGS + # @explanation + # The specified Informix Server was started successfully. + # @user_action + # None required. Informational message. + scds_syslog -p daemon.info -t $(syslog_tag) -m \ + "start_ids - Informix Server (%s) started rc(%s)" \ + "${INFORMIXSERVER}" "${rc}" + + # At present there is no equivalent "wait_for_online" within SMF + # therefore we'll perform our own. + + if [ "${CALLER}" = "SMF" ] + then + smf_wait_for_online + rc=? + fi + else + # SCMSGS + # @explanation + # The specified Informix Server failed to start. + # @user_action + # Check the syslog for further messages. If possible the + # Solaris Cluster will attempt to restart the Informix + # Server. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "start_ids - Informix Server (%s) failed to start rc(%s)" \ + "${INFORMIXSERVER}" "${rc}" + + log_message error "start_ids rc(${rc})" + fi + + debug_message "Function: start_ids - End" + return ${rc} +} + +check_start() +{ + debug_message "Function: check_start - Begin" + ${SET_DEBUG} + + if [ "${CALLER}" = "GDS" ] + then + if [ -x /sbin/zonename ] + then + /usr/bin/pgrep -z ${ZONENAME} -f "$1 .*-R ${RESOURCE} " >/dev/null 2>&1 + else + /usr/bin/pgrep -u root -f "$1 .*-R ${RESOURCE} " >/dev/null 2>&1 + fi + else + /usr/bin/pgrep -u ${USERID} -f "$1 ${RESOURCE} " >/dev/null 2>&1 + fi + + rc=$? + + debug_message "Function: check_start - End" + return ${rc} +} + +get_state() +{ + debug_message "Function: get_state - Begin" + ${SET_DEBUG} + + # The Informix Dynamic Server has an operating mode which can be obtained + # by using the "onstat -" utility that prints the output header of the + # onstat utility. The format of the output header is as follows, + # + # Version--Mode (Type)--(Checkpnt)--Up Uptime--Sh_mem Kbytes + # + # "Version" will contain the product name and version number. + # "Mode" will contain the currrent operating mode. + # + # In addition to the operating mode, the database maybe blocked from + # performing any work. If the database is blocked, the blocked reason + # is also displayed in the onstat output header. + # + # Of interest to us is "Version", "Mode" and any blocked reason. + # + # Under normal operation the product name within "Version" will contain + # "IBM Informix Dynamic Server", after which "Mode" will reflect an + # appropriate operating mode. Blocked states only appear once a "Mode" + # is reached. + # + # The following shows two sample "onstat -" outputs, + # Before IDS is started. + # + # shared memory not initialized for INFORMIXSERVER 'demo_on' + # + # After IDS is started. + # + # IBM Informix Dynamic Server Version 11.10.FC1 -- On-Line -- Up 01:47:59 -- 29696 Kbytes + + if [ "${CALLER}" = "GDS" ] + then + onstat_header=`/usr/bin/su ${USERID} -c "${TASK_COMMAND} env INFORMIXDIR=${INFORMIXDIR} INFORMIXSERVER=${INFORMIXSERVER} INFORMIXSQLHOSTS=${INFORMIXSQLHOSTS} ONCONFIG=${ONCONFIG} ${INFORMIXDIR}/bin/onstat - | /usr/bin/grep ."` + else + onstat_header=`env INFORMIXDIR=${INFORMIXDIR} INFORMIXSERVER=${INFORMIXSERVER} INFORMIXSQLHOSTS=${INFORMIXSQLHOSTS} ONCONFIG=${ONCONFIG} ${INFORMIXDIR}/bin/onstat - | /usr/bin/grep .` + fi + + if echo ${onstat_header} | /usr/xpg4/bin/grep -q "Informix Dynamic Server" + then + onstat_mode=`echo ${onstat_header} | /usr/bin/sed -e 's/ -- Up.*$//' -e 's/^.*-- //'` + + if echo ${onstat_header} | /usr/xpg4/bin/grep -q "Blocked:" + then + onstat_blocked=`echo ${onstat_header} | /usr/bin/sed -e 's/^.*Blocked://'` + else + onstat_blocked="" + fi + fi + + debug_message "Function: get_state - End" +} + +check_ids() +{ + debug_message "Function: check_ids - Begin" + ${SET_DEBUG} + + LEVEL=error + [ "$1" = "debug" ] && LEVEL=debug + + # Check if IDS is starting up. + if echo ${onstat_header} | /usr/xpg4/bin/grep -q "Changing data structure" + then + # SCMSGS + # @explanation + # The Informix Server database is starting up. + # @user_action + # None required. Solaris Cluster will restart the Informix Server + # so that it is managed by Solaris Cluster. + scds_syslog -p daemon.${LEVEL} -t $(syslog_tag) -m \ + "check_ids - Database Instance %s is restarting" \ + "${INFORMIXSERVER}" + + return 100 + fi + + # Check if IDS is down. + if echo ${onstat_header} | /usr/xpg4/bin/grep -q -E "shared memory not initialized|WARNING: IBM Informix Dynamic Server is no longer running" + then + # SCMSGS + # @explanation + # The Informix Server database is down. + # @user_action + # None required. Solaris Cluster will restart the Informix Server. + scds_syslog -p daemon.${LEVEL} -t $(syslog_tag) -m \ + "check_ids - Database Instance %s is down" \ + "${INFORMIXSERVER}" + + return 100 + fi + + # Check for any blocked states. + # Regardless of the onstat_mode, if a blocked state of "MEDIA FAILURE" or + # "HANG_SYSTEM" exists we will register a complete failure and indicate + # that the DBA needs to be involved. + + if [ -n "${onstat_blocked}" ] + then + if echo "${onstat_blocked}" | /usr/xpg4/bin/grep -q -E "MEDIA_FAILURE|HANG_SYSTEM" + then + # SCMSGS + # @explanation + # The Informix Dynamic Server database has failed. + # @user_action + # Check the system log for error messages and contact your DBA. + # Solaris Cluster will restart the Informix Server. + scds_syslog -p daemon.${LEVEL} -t $(syslog_tag) -m \ + "check_ids - Database Instance %s has failed mode(%s) blocked(%s), contact your DBA" \ + "${INFORMIXSERVER}" "${onstat_mode}" "${onstat_blocked}" + + return 100 + fi + fi + + case "${onstat_mode}" in + # Maintenance & Startup modes + "Quiescent"|"Administration"|"Single User"|"Initialization"|"Fast Recovery"|"Recovery") + + rc=100 + ;; + + # The following IDS server modes are acceptable normal operation modes. + + "On-Line"|"Read-only") # Normal operation modes + + rc=0 + ;; + + # Any other IDS server modes are treated as a complete failure. + + *) # Unknown modes + rc=100 + ;; + esac + + debug_message "check_ids - ${onstat_header}" + + if [ "${CALLER}" = "GDS" -a "${LEVEL}" != "debug" ] + then + # While we tolerate some blocked states we will output a status message + # to Solaris Cluster if one is found. Nevertheless the resource remains online. + + saved_rc=${rc} + + # Check if GDS is still starting the resource. If GDS start has finished we'll set + # the Solaris Cluster resource status with the appropriate Mode and any Blocked state. + + if ! check_start gds_svc_start + then + MESSAGE= + [ -n "${onstat_mode}" ] && MESSAGE="Mode:${onstat_mode}" + [ -n "${onstat_blocked}" ] && MESSAGE="${MESSAGE} Blocked:${onstat_blocked}" + + /usr/cluster/bin/scha_resource_setstatus -R ${RESOURCE} -G ${RESOURCEGROUP} -s OK -m "${MESSAGE}" + fi + + rc=${saved_rc} + + fi + + debug_message "Function: check_ids - End" + return ${rc} +} + +stop_ids() +{ + debug_message "Function: stop_ids - Begin" + ${SET_DEBUG} + + MAX_STOP_TIMEOUT=`/usr/bin/expr ${STOP_TIMEOUT} \* 70 \/ 100` + SECONDS=0 + + if [ "${CALLER}" = "GDS" ] + then + /usr/bin/su ${USERID} -c "${TASK_COMMAND} env INFORMIXDIR=${INFORMIXDIR} INFORMIXSERVER=${INFORMIXSERVER} INFORMIXSQLHOSTS=${INFORMIXSQLHOSTS} ONCONFIG=${ONCONFIG} ${INFORMIXDIR}/bin/onmode -uky ${OUTPUT} &" > /dev/null + + else + env INFORMIXDIR=${INFORMIXDIR} INFORMIXSERVER=${INFORMIXSERVER} INFORMIXSQLHOSTS=${INFORMIXSQLHOSTS} ONCONFIG=${ONCONFIG} ${INFORMIXDIR}/bin/onmode -uky > ${LOGFILE} 2>&1 & + fi + + while [ "${SECONDS}" -lt "${MAX_STOP_TIMEOUT}" ] + do + get_state + + if echo ${onstat_header} | /usr/xpg4/bin/grep -q "shared memory not initialized" + then + SECONDS=${MAX_STOP_TIMEOUT} + else + sleep 5 + fi + done + + # Note that the shutdown will be run in the background. As such the contents + # of ${LOGFILE} is not of interest so we will clear that file. + + cat /dev/null > ${LOGFILE} + + get_state + + if ! echo ${onstat_header} | /usr/xpg4/bin/grep -q "shared memory not initialized" + then + /usr/cluster/bin/pmfadm -s ${RESOURCEGROUP},${RESOURCE},0.svc KILL 2> /dev/null + fi + + debug_message "Function: stop_ids - End" + return 0 +} + +smf_wait_for_online() +{ + debug_message "Function: smf_wait_for_online - Begin" + ${SET_DEBUG} + + MAX_START_TIMEOUT=`/usr/bin/expr ${START_TIMEOUT} \* 95 \/ 100` + SECONDS=0 + + while [ "${SECONDS}" -lt "${MAX_START_TIMEOUT}" ] + do + get_state + check_ids + rc=$? + + # Check_ids will return 0 if + # - The Informix Server is running + # - No blocked on "MEDIA FAILURE" or "HANG_SYSTEM" exists + + if [ "${rc}" -eq 0 ] + then + SECONDS=${MAX_START_TIMEOUT} + else + sleep 5 + fi + done + + debug_message "Function: smf_wait_for_online - End" + return ${rc} +} + +cleanup_ipc() +{ + debug_message "Function: cleanup_ipc - Begin" + ${SET_DEBUG} + + # Cleanup any IPC shared memory segments however only if + # + # - The shared memory segment(s) are owned by + # OWNER=root and GROUP=informix + # - The shared memory has no attached processes + # - The CPID and LPID processes are not running + + flag= + + if [ "${DEBUG}" = "${RESOURCE}" -o "${DEBUG}" = "ALL" ] + then + debug_message "IPC Status BEFORE removal of non-attached segments created by group informix" + /usr/bin/ipcs -mcopbZ | /usr/bin/grep " ${ZONENAME}$" > ${LOGFILE} + log_message debug ipcs + fi + + /usr/bin/ipcs -mcopbZ | /usr/bin/grep " ${ZONENAME}$" | /usr/bin/awk ' \ + {if (NF == 13 && $5 == "root" && $6 == "informix" && $9 == 0 ) print $2,$11,$12; else \ + if (NF == 12 && $4 == "root" && $5 == "informix" && $8 == 0 ) print $1,$10,$11 }' | \ + while read SHMID CPID LPID + do + if /usr/bin/ps -p ${LPID} -o zone | /usr/bin/grep " ${ZONENAME}$" > /dev/null + then + debug_message "Informix SHMID: ${SHMID} - LPID ${LPID} is running" + else + if /usr/bin/ps -p ${CPID} -o zone | /usr/bin/grep " ${ZONENAME}$" > /dev/null + then + debug_message "Informix SHMID: ${SHMID} - CPID ${CPID} is running" + else + SHMID=`/usr/bin/echo ${SHMID} | /usr/xpg4/bin/tr 'm' ' '` + + # As the initial ipcs -mcopbZ is only a snapshot in time, Informix + # may have already cleaned up. Therefore the following attempt to remove a + # shared memory segment may fail with "not found". To prevent misleading + # console messages stdout/stderr is redirected to ${LOGFILE}. + + /usr/bin/ipcrm -z ${ZONENAME} -m ${SHMID} > ${LOGFILE} + + debug_message "Informix SHMID: ${SHMID} - removed" + + flag=deleted + fi + fi + done + + if [ -n "${flag}" ] + then + # SCMSGS + # @explanation + # All the Informix shared memory segments that were not being + # used have been removed. + # @user_action + # None required. Informational message. + scds_syslog -p daemon.notice -t $(syslog_tag) -m \ + "All Informix non-attached IPC shared memory segments removed" + fi + + debug_message "IPC Status AFTER removal of non-attached segments created by group informix" + + if [ "${DEBUG}" = "${RESOURCE}" -o "${DEBUG}" = "ALL" ] + then + /usr/bin/ipcs -mcopbZ | /usr/bin/grep " ${ZONENAME}$" > ${LOGFILE} + log_message debug ipcs + fi + + debug_message "Function: cleanup_ipc - End" + return 0 +} --- /dev/null Tue Jan 22 20:55:28 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/SUNW.ids Tue Jan 22 20:55:28 2008 @@ -0,0 +1,39 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# + +RESOURCE_TYPE = "ids"; +VENDOR_ID = SUNW; +RT_DESCRIPTION = "Sun Cluster HA for Informix Dynamic Server"; + +RT_VERSION ="1.0"; +API_VERSION = 2; +FAILOVER = FALSE; + +RT_BASEDIR=/opt/SUNWscids; +PKGLIST = SUNWscids; + +# For package upgrade +#% SERVICE_NAME = "ids" --- /dev/null Tue Jan 22 20:55:28 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/ids_register.ksh Tue Jan 22 20:55:28 2008 @@ -0,0 +1,143 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# DO NOT EDIT THIS FILE + +IDSDIR=/opt/SUNWscids/ + +typeset opt + +while getopts 'f:' opt +do + case "$opt" in + f) MYCONFIG=${OPTARG};; + *) /usr/bin/echo "ERROR: ${MYNAME} Option ${OPTARG} unknown" + /usr/bin/echo "Usage: ${MYNAME} -f " + exit 1;; + esac +done + +[ -z "${MYCONFIG}" ] && MYCONFIG=/opt/SUNWscids/util/ids_config + +. ${MYCONFIG} + +if [ -z ${RS_ZONE} ] +then + +/usr/cluster/bin/clrs create -g ${RG} -t SUNW.gds \ +-p Start_command="/opt/SUNWscids/bin/control_ids \ +-R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' \ +-S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' start ids " \ +-p Stop_command="/opt/SUNWscids/bin/control_ids \ +-R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' \ +-S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' stop ids " \ +-p Probe_command="/opt/SUNWscids/bin/control_ids \ +-R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' \ +-S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' probe ids " \ +-p Validate_command="/opt/SUNWscids/bin/control_ids \ +-R '${RS}' -G '${RG}' -U '${USERID}' -D '${INFORMIXDIR}' -C '${ONCONFIG}' \ +-S '${INFORMIXSERVER}' -H '${INFORMIXSQLHOSTS}' validate ids " \ +-p Port_list=23/tcp -p Stop_signal=9 \ +-y Resource_dependencies=${HAS_RS},${LH_RS} \ +${RS} + +else + # Process a failover zone registration + # + # 1. Validate ${START_TIMEOUT} and ${STOP_TIMEOUT} + # 2. Get the failover zone's pfile and determine failover zone name + # 3. Build a temporary sczsmf_config file + # 4. zlogin to the failover zone execute ids_smf_register + # - Creates the SMF manifest using parameter values + # - Validate and import the SMF manifest into the SMF repository + # 5. Register a SC sczsmf resource to enable/disable the SMF instance + + RS_STATE=`/usr/cluster/bin/scha_resource_get -O status -R ${RS}` + rc=$? + + if [ "${rc}" -eq 0 ] + then + /usr/bin/printf "Sun Cluster resource ${RS} already exists\n" + /usr/bin/printf "Cleanup resource before retrying\n" + exit 1 + fi + + if ! [ "${START_TIMEOUT}" -ge 0 ] 2> /dev/null + then + /usr/bin/printf "START_TIMEOUT value is not an integer\n" + exit 1 + fi + + if ! [ "${STOP_TIMEOUT}" -ge 0 ] 2> /dev/null + then + /usr/bin/printf "STOP_TIMEOUT value is not an integer\n" + exit 1 + fi + + ZONEPFILE=`/usr/cluster/bin/clrs show -p Start_command ${RS_ZONE} | /usr/bin/grep -w Start_command | \ + /usr/bin/awk '{ if ($7 == "-P") print $8 }'` + + if [ ! -d "${ZONEPFILE}" ] + then + /usr/bin/printf "Unable to retrieve zone parameter file directory\n" + exit 1 + else + ZONE=`/usr/bin/grep Zonename= ${ZONEPFILE}/sczbt_${RS_ZONE} | /usr/bin/awk -F= '{print $2}' | /usr/xpg4/bin/tr -d '"' ` + fi + + SERVICE_TAG=svc:/application/sczone-agents:${RS} + + /usr/bin/cat > /var/tmp/${RS}_smf_config <<-EOF +RS=${RS} +RG=${RG} +SCZBT_RS=${RS_ZONE} +ZONE=${ZONE} +SERVICE=${SERVICE_TAG} +RECURSIVE=true +STATE=true +SERVICE_PROBE="/opt/SUNWscids/bin/control_ids probe ids ${SERVICE_TAG}" +EOF + + TMP_WORK_CONFIG=/var/tmp/${RS}_tmp_work_config + /usr/bin/cat ${MYCONFIG} | /usr/sbin/zlogin ${ZONE} /usr/bin/cat - \> ${TMP_WORK_CONFIG} + + # Remove an existing FMRI in the zone if it already exists + ${IDSDIR}/util/ids_smf_remove -z ${ZONE} -f ${SERVICE_TAG} 2>/dev/null + + # Create and register the ${SERVICE_TAG} + 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" + else + /usr/bin/printf "Registration of ${RS} failed\n" + exit 1 + fi + fi +fi + +exit 0 --- /dev/null Tue Jan 22 20:55:28 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/config Tue Jan 22 20:55:28 2008 @@ -0,0 +1,30 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# +# Usage: +# DEBUG= or ALL +# +DEBUG= --- /dev/null Tue Jan 22 20:55:28 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/ids_config Tue Jan 22 20:55:28 2008 @@ -0,0 +1,76 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# +# This file will be sourced in by ids_register and the parameters +# listed below will be used. +# +# These parameters can be customized in (key=value) form +# +# +++ Required parameters +++ +# +# RS - name of the SC resource for the Informix Server +# RG - name of the SC resource group to contain RS +# LH_RS - name of the SC LogicalHostname resource +# HAS_RS - name of the SC HAStoragePlus resource +# USERID - name of the Informix Server userid +# ONCONFIG - name of the ONCONFIG filename within ${INFORMIXDIR}/etc +# INFORMIXDIR - name of the Informix directory +# INFORMIXSERVER - name of the Informix Database Server +# INFORMIXSQLHOSTS - name of the Informix SQL hosts file +# +# +++ Failover zone parameters +++ +# +# These parameters are only required when the Informix Server should +# run within a failover zone managed by the Sun Cluster Data Service +# for Solaris Containers. +# +# RS_ZONE - name of the Failover zone managed by the +# Sun Cluster Data Service for Solaris Containers +# PROJECT - name for the Solaris Project to be used +# (Default PROJECT=default) +# START_TIMEOUT - start timeout value +# (Default START_TIMEOUT=300) +# STOP_TIMEOUT - stop timeout value +# (Default STOP_TIMEOUT=300) +# +# +++ Required parameters +++ +# +RS= +RG= +LH_RS= +HAS_RS= +USERID= +ONCONFIG= +INFORMIXDIR= +INFORMIXSERVER= +INFORMIXSQLHOSTS= + +# +++ Failover zone parameters +++ +# +RS_ZONE= +PROJECT=default +START_TIMEOUT=300 +STOP_TIMEOUT=300 --- /dev/null Tue Jan 22 20:55:29 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/ids_smf_remove.ksh Tue Jan 22 20:55:29 2008 @@ -0,0 +1,71 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# DO NOT EDIT THIS FILE +# + +rc=0 +MYNAME=`basename $0` + +typeset opt + +while getopts 'z:f:' opt +do + case "${opt}" in + z) ZONE=${OPTARG};; + f) FMRI=${OPTARG};; + *) echo "ERROR: ${MYNAME} Option ${OPTARG} unknown" + echo "Usage: ${MYNAME} -z -f " + exit 1;; + esac +done + +if [ -z "${ZONE}" ] +then + /usr/bin/printf "ERROR: ${MYNAME} -z not specified\n" + rc=1 +fi + +if [ -z "${FMRI}" ] +then + /usr/bin/printf "ERROR: ${MYNAME} -f not specified\n" + rc=1 +fi + +[ "${rc}" -ne 0 ] && exit ${rc} + +if /usr/sbin/zlogin ${ZONE} /usr/sbin/svcadm disable ${FMRI} +then + /usr/bin/printf "${FMRI} found in ${ZONE}\n" + /usr/bin/printf "${FMRI} disabled in ${ZONE}\n" +fi + +if /usr/sbin/zlogin ${ZONE} /usr/sbin/svccfg delete ${FMRI} +then + /usr/bin/printf "${FMRI} deleted in ${ZONE}\n" +fi + +exit ${rc} --- /dev/null Tue Jan 22 20:55:29 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/control_ids.ksh Tue Jan 22 20:55:29 2008 @@ -0,0 +1,173 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# Usage GDS: +# +# Usage SMF: +# +# : -R -G etc. +# parameter1: start | stop | probe +# parameter2: ids +# parameter3: + +MYNAME=`/usr/bin/basename $0` +MYDIR=`/usr/bin/dirname $0` + +. ${MYDIR}/../etc/config + +typeset opt + +while getopts 'R:G:U:D:C:S:H:' opt +do + case "${opt}" in + R) RESOURCE=${OPTARG};; + G) RESOURCEGROUP=${OPTARG};; + U) USERID=${OPTARG};; + D) INFORMIXDIR=${OPTARG};; + C) ONCONFIG=${OPTARG};; + S) INFORMIXSERVER=${OPTARG};; + H) INFORMIXSQLHOSTS=${OPTARG};; + *) exit 1;; + esac +done + +if [ "${OPTIND}" -gt 1 ] +then + # Called by GDS + CALLER=GDS + + shift $((${OPTIND} -1)) +else + # Called by SMF + CALLER=SMF + + . /lib/svc/share/smf_include.sh + + SMF_FMRI=${3} +fi + +METHOD=${1} +COMPONENT=${2} + +if [ "${CALLER}" = "GDS" ] +then + . ${MYDIR}/functions + + # Perform all the scha* calls + TASK_COMMAND="" + + if [ "${METHOD}" = "start" ] + then + START_TIMEOUT=`/usr/cluster/bin/scha_resource_get -O START_TIMEOUT \ + -R ${RESOURCE} -G ${RESOURCEGROUP} ` + fi + + if [ "${METHOD}" = "stop" ] + then + STOP_TIMEOUT=`/usr/cluster/bin/scha_resource_get -O STOP_TIMEOUT \ + -R ${RESOURCE} -G ${RESOURCEGROUP} ` + fi + + # Retrieve the resource project name so that we can run any + # Informix commands under the specified user's project. + + RESOURCE_PROJECT_NAME=`/usr/cluster/bin/scha_resource_get \ + -R ${RESOURCE} -G ${RESOURCEGROUP} -O RESOURCE_PROJECT_NAME` + + if [ -z "${RESOURCE_PROJECT_NAME}" -o "${RESOURCE_PROJECT_NAME}" = "default" ] + then + # Retrieve the resource group project name + RESOURCE_PROJECT_NAME=`/usr/cluster/bin/scha_resourcegroup_get \ + -G ${RESOURCEGROUP} -O RG_PROJECT_NAME` + fi + + # Validate that ${USERID} belongs to the ${RESOURCE_PROJECT_NAME} + if [ -n "${RESOURCE_PROJECT_NAME}" ] + then + PROJ_MEMBER=`/usr/bin/projects ${USERID} | /usr/bin/egrep "^${RESOURCE_PROJECT_NAME} | \ + ${RESOURCE_PROJECT_NAME} | ${RESOURCE_PROJECT_NAME}$|^${RESOURCE_PROJECT_NAME}$"` + fi + + if [ -z "${PROJ_MEMBER}" ] + then + # SCMSGS + # @explanation + # The userid does not belong to the specified project. + # @user_action + # Ensure the userid exists within the project. Check that + # you have the correct userid and project name. + scds_syslog -p daemon.notice -t $(syslog_tag) -m \ + "%s - The user %s does not belong to project %s" \ + "${MYNAME}" "${USERID}" "${RESOURCE_PROJECT_NAME}" + return 1 + else + TASK_COMMAND="/usr/bin/newtask -p ${RESOURCE_PROJECT_NAME}" + fi +else + for i in RESOURCE RESOURCEGROUP INFORMIXDIR ONCONFIG INFORMIXSERVER \ + INFORMIXSQLHOSTS START_TIMEOUT STOP_TIMEOUT + do + export $i=`/usr/bin/svcprop -p parameters/$i ${SMF_FMRI}` + done + + USERID=`/usr/bin/svcprop -p start/user ${SMF_FMRI}` + PROJECT=`/usr/bin/svcprop -p start/project ${SMF_FMRI}` + + . ${MYDIR}/functions +fi + +debug_message "Method: ${MYNAME} - Begin" +${SET_DEBUG} + +[ -x /sbin/zonename ] && ZONENAME=`/sbin/zonename` + +set_redirection + +case "${METHOD}" in + start) + cleanup_ipc + start_ids + rc=$? + ;; + + stop) + stop_ids + rc=0 + ;; + + probe) + get_state + check_ids + rc=$? + ;; + validate) + validate + rc=$? + ;; +esac + +debug_message "Method: ${MYNAME} - End" +exit ${rc} --- /dev/null Tue Jan 22 20:55:29 2008 +++ new/usr/src/cmd/ha-services/gds-agents/ids/ids_smf_register.ksh Tue Jan 22 20:55:29 2008 @@ -0,0 +1,153 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# +# DO NOT EDIT THIS FILE +# + +create_xml() +{ + MYDIR=/opt/SUNWscids + MANIFEST_DIR=/var/svc/manifest/application/sczone-agents + + [ ! -d "${MANIFEST_DIR}" ] && mkdir -p ${MANIFEST_DIR} + + cat > ${MANIFEST_DIR}/${RS}.xml <<-EOF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EOF +} + +# $1 is passed from ids_register as ${TMP_WORK_CONFIG} +if [ -n "${1}" ] +then + . $1 +else + /usr/bin/printf "Configuration file not found\n" +fi + +create_xml + +/usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully created\n" + +if /usr/sbin/svccfg validate ${MANIFEST_DIR}/${RS}.xml; then + /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully validated\n" +else + /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml validation failed\n" + exit 1 +fi + +if /usr/sbin/svccfg import ${MANIFEST_DIR}/${RS}.xml; then + /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully imported\n" +else + /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml import failed\n" + exit 1 +fi + +exit 0 --- old/usr/src/pkgdefs/dot.order.sun_cluster_agents.sparc Tue Jan 22 20:55:29 2008 +++ new/usr/src/pkgdefs/dot.order.sun_cluster_agents.sparc Tue Jan 22 20:55:29 2008 @@ -5,6 +5,7 @@ SUNWscdns SUNWscebs SUNWschadb +SUNWscids SUNWsckrb5 SUNWsclc SUNWscmqi --- old/usr/src/pkgdefs/Makefile Tue Jan 22 20:55:30 2008 +++ new/usr/src/pkgdefs/Makefile Tue Jan 22 20:55:30 2008 @@ -58,6 +58,7 @@ SUNWscPostgreSQL \ SUNWsc9ias \ SUNWscdhc \ + SUNWscids \ SUNWscmqs \ SUNWscmys \ SUNWsctomcat \ @@ -65,7 +66,7 @@ SUNWscmqi \ SUNWscsmb \ SUNWscsaa \ - SUNWscsag + SUNWscsag $(CLOSED_BUILD)PRODUCT_SUBDIRS += \ SUNWscor \ --- old/usr/src/pkgdefs/dot.clustertoc.sun_cluster_agents.i386 Tue Jan 22 20:55:30 2008 +++ new/usr/src/pkgdefs/dot.clustertoc.sun_cluster_agents.i386 Tue Jan 22 20:55:30 2008 @@ -104,6 +104,17 @@ END # +# Sun Cluster HA for Informix Dynamic Server +# +CLUSTER=SUNWC_DS_ids +NAME=Sun Cluster HA for Informix Dynamic Server +DESC=Sun Cluster HA for Informix Dynamic Server +VENDOR=Sun Microsystems, Inc. +VERSION=3.2 +SUNW_CSRMEMBER=SUNWscids +END + +# # Sun Cluster HA for Kerberos # CLUSTER=SUNWC_DS_kerberos @@ -392,3 +403,4 @@ VERSION=3.1 SUNW_CSRMEMBER=SUNWscwls END + --- old/usr/src/pkgdefs/jas.dvdimage.ksh Tue Jan 22 20:55:31 2008 +++ new/usr/src/pkgdefs/jas.dvdimage.ksh Tue Jan 22 20:55:31 2008 @@ -73,6 +73,8 @@ PACKAGES_HADB=SUNWschadb +PACKAGES_IDS=SUNWscids + PACKAGES_KERBEROS=SUNWsckrb5 PACKAGES_L10N="\ @@ -264,6 +266,7 @@ ${PACKAGES_DNS} \ ${PACKAGES_EBS} \ ${PACKAGES_HADB} \ + ${PACKAGES_IDS} \ ${PACKAGES_KERBEROS} \ ${PACKAGES_L10N} \ ${PACKAGES_LIVECACHE} \ --- old/usr/src/pkgdefs/dot.order.sun_cluster_agents.i386 Tue Jan 22 20:55:31 2008 +++ new/usr/src/pkgdefs/dot.order.sun_cluster_agents.i386 Tue Jan 22 20:55:31 2008 @@ -5,6 +5,7 @@ SUNWscdns SUNWscebs SUNWschadb +SUNWscids SUNWsckrb5 SUNWsclc SUNWscmqi --- old/usr/src/pkgdefs/dot.clustertoc.sun_cluster_agents.sparc Tue Jan 22 20:55:32 2008 +++ new/usr/src/pkgdefs/dot.clustertoc.sun_cluster_agents.sparc Tue Jan 22 20:55:32 2008 @@ -104,6 +104,17 @@ END # +# Sun Cluster HA for Informix Dynamic Server +# +CLUSTER=SUNWC_DS_ids +NAME=Sun Cluster HA for Informix Dynamic Server +DESC=Sun Cluster HA for Informix Dynamic Server +VENDOR=Sun Microsystems, Inc. +VERSION=3.2 +SUNW_CSRMEMBER=SUNWscids +END + +# # Sun Cluster HA for Kerberos # CLUSTER=SUNWC_DS_kerberos @@ -407,3 +418,4 @@ VERSION=3.1 SUNW_CSRMEMBER=SUNWscwls END + --- /dev/null Tue Jan 22 20:55:33 2008 +++ new/usr/src/pkgdefs/SUNWscids/Makefile Tue Jan 22 20:55:33 2008 @@ -0,0 +1,40 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# + +include ../Makefile.com + +BASEDIR = /opt + +DATAFILES += depend + +.KEEP_STATE: + +all: $(FILES) +install: all pkg + +include ../Makefile.targ --- /dev/null Tue Jan 22 20:55:33 2008 +++ new/usr/src/pkgdefs/SUNWscids/pkginfo.tmpl Tue Jan 22 20:55:33 2008 @@ -0,0 +1,54 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# This required package information file describes characteristics of the +# package, such as package abbreviation, full package name, package version, +# and package architecture. +# +PKG="SUNWscids" +NAME="Sun Cluster HA for Informix Dynamic Server" +ARCH="ISA" +VERSION="3.2.0,REV=0.0.0" +SUNW_PRODNAME="Sun Cluster" +SUNW_PRODVERS="RELEASE/VERSION" +SUNW_PKGVERS="1.0" +SUNW_PKGTYPE="" +MAXINST="1000" +CATEGORY="application" +DESC="Sun Cluster HA for Informix Dynamic Server" +VENDOR="Sun Microsystems, Inc." +HOTLINE="Please contact your local service provider" +EMAIL="" +CLASSES="none" +BASEDIR=/opt +#VSTOCK="" +#ISTATES="" +#RSTATES='' +#ULIMIT="" +#ORDER="" +#PSTAMP="" +#INTONLY="" --- /dev/null Tue Jan 22 20:55:33 2008 +++ new/usr/src/pkgdefs/SUNWscids/depend.tmpl Tue Jan 22 20:55:33 2008 @@ -0,0 +1,45 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# This package information file defines software dependencies associated +# with the pkg. You can define three types of pkg dependencies with this file: +# P indicates a prerequisite for installation +# I indicates an incompatible package +# R indicates a reverse dependency +# see pkginfo(4), PKG parameter +# see pkginfo(4), NAME parameter +# see pkginfo(4), VERSION parameter +# see pkginfo(4), ARCH parameter +# +# () +# () +# ... +# +# ... + +P SUNWscr Sun Cluster, (root) +P SUNWscgds Sun Cluster Generic Data Service --- /dev/null Tue Jan 22 20:55:33 2008 +++ new/usr/src/pkgdefs/SUNWscids/prototype_i386 Tue Jan 22 20:55:33 2008 @@ -0,0 +1,49 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# This required package information file contains a list of package contents. +# The 'pkgmk' command uses this file to identify the contents of a package +# and their location on the development machine when building the package. +# Can be created via a text editor or through use of the 'pkgproto' command. + +#!search # where to find pkg objects +#!include # include another 'prototype' file +#!default # default used if not specified on entry +#!= # puts parameter in pkg environment + +# +# Include ISA independent files (prototype_com) +# +!include prototype_com +# +# +# List files which are i386 specific here +# +# source locations relative to the prototype file +# +# SUNWscids +# --- /dev/null Tue Jan 22 20:55:33 2008 +++ new/usr/src/pkgdefs/SUNWscids/prototype_com Tue Jan 22 20:55:33 2008 @@ -0,0 +1,63 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# This required package information file contains a list of package contents. +# The 'pkgmk' command uses this file to identify the contents of a package +# and their location on the development machine when building the package. +# Can be created via a text editor or through use of the 'pkgproto' command. + +#!search # where to find pkg objects +#!include # include another 'prototype' file +#!default # default used if not specified on entry +#!= # puts parameter in pkg environment + +# packaging files +i depend +i pkginfo +i copyright +# +# source locations relative to the prototype file +# +# SUNWscids +# +d none SUNWscids 0755 root bin +d none SUNWscids/bin 0755 root bin +f none SUNWscids/bin/control_ids 0555 root bin +f none SUNWscids/bin/functions 0555 root bin +d none SUNWscids/etc 0755 root bin +f none SUNWscids/etc/SUNW.ids 0444 root bin +f none SUNWscids/etc/config 0644 root bin +d none SUNWscids/util 0755 root bin +f none SUNWscids/util/ids_config 0644 root bin +f none SUNWscids/util/ids_register 0555 root bin +f none SUNWscids/util/ids_smf_register 0555 root bin +f none SUNWscids/util/ids_smf_remove 0555 root bin +d none cluster 0755 root bin +d none cluster/lib 0755 root bin +d none cluster/lib/rgm 0755 root bin +d none cluster/lib/rgm/gdsdata 0755 root bin +s none cluster/lib/rgm/gdsdata/SUNW.ids=../../../../SUNWscids/etc/SUNW.ids --- /dev/null Tue Jan 22 20:55:34 2008 +++ new/usr/src/pkgdefs/SUNWscids/prototype_sparc Tue Jan 22 20:55:34 2008 @@ -0,0 +1,48 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the License). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/CDDL.txt +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/CDDL.txt. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets [] replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# This required package information file contains a list of package contents. +# The 'pkgmk' command uses this file to identify the contents of a package +# and their location on the development machine when building the package. +# Can be created via a text editor or through use of the 'pkgproto' command. + +#!search # where to find pkg objects +#!include # include another 'prototype' file +#!default # default used if not specified on entry +#!= # puts parameter in pkg environment + +# +# Include ISA independent files (prototype_com) +# +!include prototype_com +# +# List files which are SPARC specific here +# +# source locations relative to the prototype file +# +# SUNWscids +#