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