1 #!/usr/bin/ksh 2 # 3 # CDDL HEADER START 4 # 5 # The contents of this file are subject to the terms of the 6 # Common Development and Distribution License (the License). 7 # You may not use this file except in compliance with the License. 8 # 9 # You can obtain a copy of the license at usr/src/CDDL.txt 10 # or http://www.opensolaris.org/os/licensing. 11 # See the License for the specific language governing permissions 12 # and limitations under the License. 13 # 14 # When distributing Covered Code, include this CDDL HEADER in each 15 # file and include the License file at usr/src/CDDL.txt. 16 # If applicable, add the following below this CDDL HEADER, with the 17 # fields enclosed by brackets [] replaced with your own identifying 18 # information: Portions Copyright [yyyy] [name of copyright owner] 19 # 20 # CDDL HEADER END 21 # 22 23 # 24 # Copyright 2006 Sun Microsystems, Inc. All rights reserved. 25 # Use is subject to license terms. 26 # 27 #ident "@(#)mgr_smf_register.ksh 1.4 07/08/07 SMI" 28 # 29 # DO NOT EDIT THIS FILE 30 # 31 32 create_xml() 33 { 34 COMPONENT=qmgr 35 MYDIR=/opt/SUNWscmqs 36 MANIFEST_DIR=/var/svc/manifest/application/sczone-agents 37 38 [ ! -d "${MANIFEST_DIR}" ] && mkdir -p ${MANIFEST_DIR} 39 40 cat > ${MANIFEST_DIR}/${RS}.xml <<-EOF 41 <?xml version="1.0"?> 42 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> 43 44 <!-- 45 Copyright 2006 Sun Microsystems, Inc. All rights reserved. 46 Use is subject to license terms. 47 --> 48 49 <service_bundle type='manifest' name='${RS}'> 50 51 <service 52 name='application/sczone-agents' 53 type='service' 54 version='1'> 55 56 <instance name='${RS}' enabled='false'> 57 58 <!-- 59 Dependencies 60 --> 61 62 <dependency name='${COMPONENT}_services' 63 grouping='require_all' 64 restart_on='none' 65 type='service'> 66 <service_fmri value='svc:/milestone/multi-user-server'/> 67 <service_fmri value='svc:/network/loopback'/> 68 <service_fmri value='svc:/network/physical'/> 69 </dependency> 70 71 <dependency name='${COMPONENT}_paths' 72 grouping='require_all' 73 restart_on='none' 74 type='path'> 75 <service_fmri value='file:///var/mqm'/> 76 <service_fmri value='file:///opt/mqm'/> 77 </dependency> 78 79 <exec_method 80 type='method' 81 name='start' 82 exec='${MYDIR}/bin/control_wmqs start ${COMPONENT} ${RS}' 83 timeout_seconds='300' > 84 <method_context project='${PROJECT}' > 85 <method_credential user='${USERID}' /> 86 </method_context> 87 </exec_method> 88 89 <exec_method 90 type='method' 91 name='stop' 92 exec='${MYDIR}/bin/control_wmqs stop ${COMPONENT} ${RS}' 93 timeout_seconds='300' > 94 <method_context project='${PROJECT}'> 95 <method_credential user='${USERID}' /> 96 </method_context> 97 </exec_method> 98 99 <property_group name='parameters' type='general'> 100 <propval name='RESOURCE' type='astring' value='${RS}'/> 101 <propval name='RESOURCEGROUP' type='astring' value='${RG}'/> 102 <propval name='QMGR' type='astring' value='${QMGR}'/> 103 <propval name='SERVICES' type='astring' value='${SERVICES}'/> 104 <propval name='CLEANUP' type='astring' value='${CLEANUP}'/> 105 <propval name='DB2INSTANCE' type='astring' value='${DB2INSTANCE}'/> 106 <propval name='ORACLE_HOME' type='astring' value='${ORACLE_HOME}'/> 107 <propval name='ORACLE_SID' type='astring' value='${ORACLE_SID}'/> 108 <propval name='START_COMMAND' type='astring' value='${START_COMMAND}'/> 109 <propval name='STOP_COMMAND' type='astring' value='${STOP_COMMAND}'/> 110 <propval name='STOP_TIMEOUT' type='astring' value='${TIMEOUT}'/> 111 </property_group> 112 113 <property_group name='startd' type='framework'> 114 <propval name='duration' type='astring' value='transient' /> 115 <propval name='ignore_error' type='astring' value='core'/> 116 </property_group> 117 118 </instance> 119 120 <stability value='Evolving' /> 121 122 <template> 123 <common_name> 124 <loctext xml:lang='C'> 125 WebSphere MQ 126 </loctext> 127 </common_name> 128 </template> 129 </service> 130 131 </service_bundle> 132 133 EOF 134 } 135 136 # $1 is passed from mgr_register as ${TMP_WORK_CONFIG} 137 . $1 138 139 create_xml 140 141 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully created\n" 142 143 if /usr/sbin/svccfg validate ${MANIFEST_DIR}/${RS}.xml; then 144 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully validated\n" 145 else 146 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml validation failed\n" 147 exit 1 148 fi 149 150 if /usr/sbin/svccfg import ${MANIFEST_DIR}/${RS}.xml; then 151 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully imported\n" 152 else 153 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml import failed\n" 154 exit 1 155 fi 156 157 exit 0 158