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 "@(#)csv_smf_register.ksh 1.4 07/08/07 SMI" 28 # 29 # DO NOT EDIT THIS FILE 30 # 31 32 create_xml() 33 { 34 COMPONENT=csv 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 </property_group> 104 105 <property_group name='startd' type='framework'> 106 <propval name='duration' type='astring' value='transient' /> 107 <propval name='ignore_error' type='astring' value='core'/> 108 </property_group> 109 110 </instance> 111 112 <stability value='Evolving' /> 113 114 <template> 115 <common_name> 116 <loctext xml:lang='C'> 117 WebSphere MQ 118 </loctext> 119 </common_name> 120 </template> 121 </service> 122 123 </service_bundle> 124 125 EOF 126 } 127 128 # $1 is passed from csv_register as ${TMP_WORK_CONFIG} 129 . $1 130 131 create_xml 132 133 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully created\n" 134 135 if /usr/sbin/svccfg validate ${MANIFEST_DIR}/${RS}.xml; then 136 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully validated\n" 137 else 138 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml validation failed\n" 139 exit 1 140 fi 141 142 if /usr/sbin/svccfg import ${MANIFEST_DIR}/${RS}.xml; then 143 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml successfully imported\n" 144 else 145 /usr/bin/printf "${MANIFEST_DIR}/${RS}.xml import failed\n" 146 exit 1 147 fi 148 149