Merge lp:~trond-norbye/drizzle/smf-integration into lp:~drizzle-trunk/drizzle/development
- smf-integration
- Merge into development
Proposed by
Trond Norbye
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~trond-norbye/drizzle/smf-integration |
Merge into: | lp:~drizzle-trunk/drizzle/development |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~trond-norbye/drizzle/smf-integration |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Developers | Pending | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Trond Norbye (trond-norbye) wrote : | # |
- 1027. By Trond Norbye
-
Remove output from ed during smf install
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2009-05-07 21:25:23 +0000 | |||
3 | +++ .bzrignore 2009-05-18 17:46:43 +0000 | |||
4 | @@ -36,6 +36,10 @@ | |||
5 | 36 | strings/Makefile.in | 36 | strings/Makefile.in |
6 | 37 | strings/tests/Makefile.in | 37 | strings/tests/Makefile.in |
7 | 38 | support-files/Makefile.in | 38 | support-files/Makefile.in |
8 | 39 | support-files/smf/Makefile.in | ||
9 | 40 | support-files/smf/install.sh | ||
10 | 41 | support-files/smf/drizzle | ||
11 | 42 | support-files/smf/drizzle.xml | ||
12 | 39 | tests/Makefile.in | 43 | tests/Makefile.in |
13 | 40 | unittest/Makefile.in | 44 | unittest/Makefile.in |
14 | 41 | unittest/examples/Makefile.in | 45 | unittest/examples/Makefile.in |
15 | 42 | 46 | ||
16 | === modified file 'configure.ac' | |||
17 | --- configure.ac 2009-05-14 06:01:02 +0000 | |||
18 | +++ configure.ac 2009-05-18 17:46:43 +0000 | |||
19 | @@ -1453,7 +1453,11 @@ | |||
20 | 1453 | support-files/Makefile dnl | 1453 | support-files/Makefile dnl |
21 | 1454 | tests/Makefile tests/install_test_db dnl | 1454 | tests/Makefile tests/install_test_db dnl |
22 | 1455 | drizzled/drizzled_safe dnl | 1455 | drizzled/drizzled_safe dnl |
24 | 1456 | support-files/drizzle.server support-files/drizzle-log-rotate) | 1456 | support-files/drizzle.server support-files/drizzle-log-rotate |
25 | 1457 | support-files/smf/Makefile dnl | ||
26 | 1458 | support-files/smf/install.sh dnl | ||
27 | 1459 | support-files/smf/drizzle.xml dnl | ||
28 | 1460 | support-files/smf/drizzle) | ||
29 | 1457 | 1461 | ||
30 | 1458 | scheduling_plugins_available=" | 1462 | scheduling_plugins_available=" |
31 | 1459 | pool_of_threads | 1463 | pool_of_threads |
32 | 1460 | 1464 | ||
33 | === modified file 'support-files/Makefile.am' | |||
34 | --- support-files/Makefile.am 2009-04-07 08:32:11 +0000 | |||
35 | +++ support-files/Makefile.am 2009-05-18 17:46:43 +0000 | |||
36 | @@ -15,6 +15,8 @@ | |||
37 | 15 | # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, | 15 | # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
38 | 16 | # MA 02111-1307, USA | 16 | # MA 02111-1307, USA |
39 | 17 | 17 | ||
40 | 18 | SUBDIRS = smf | ||
41 | 19 | |||
42 | 18 | pkgconfigdir = $(libdir)/pkgconfig | 20 | pkgconfigdir = $(libdir)/pkgconfig |
43 | 19 | 21 | ||
44 | 20 | # Default same as 'pkgdatadir', but we can override it | 22 | # Default same as 'pkgdatadir', but we can override it |
45 | 21 | 23 | ||
46 | === added directory 'support-files/smf' | |||
47 | === added file 'support-files/smf/Makefile.am' | |||
48 | --- support-files/smf/Makefile.am 1970-01-01 00:00:00 +0000 | |||
49 | +++ support-files/smf/Makefile.am 2009-05-18 17:46:43 +0000 | |||
50 | @@ -0,0 +1,16 @@ | |||
51 | 1 | # Copyright (C) 2009 Sun Microsystems | ||
52 | 2 | # | ||
53 | 3 | # This program is free software; you can redistribute it and/or modify | ||
54 | 4 | # it under the terms of the GNU General Public License as published by | ||
55 | 5 | # the Free Software Foundation; version 2 of the License. | ||
56 | 6 | # | ||
57 | 7 | # This program is distributed in the hope that it will be useful, | ||
58 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
59 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
60 | 10 | # GNU General Public License for more details. | ||
61 | 11 | # | ||
62 | 12 | # You should have received a copy of the GNU General Public License | ||
63 | 13 | # along with this program; if not, write to the Free Software | ||
64 | 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
65 | 15 | |||
66 | 16 | EXTRA_DIST= install.sh drizzle.xml drizzle | ||
67 | 0 | 17 | ||
68 | === added file 'support-files/smf/drizzle.in' | |||
69 | --- support-files/smf/drizzle.in 1970-01-01 00:00:00 +0000 | |||
70 | +++ support-files/smf/drizzle.in 2009-05-18 17:46:43 +0000 | |||
71 | @@ -0,0 +1,41 @@ | |||
72 | 1 | #!/sbin/sh | ||
73 | 2 | # Copyright (C) 2009 Sun Microsystems | ||
74 | 3 | # | ||
75 | 4 | # This program is free software; you can redistribute it and/or modify | ||
76 | 5 | # it under the terms of the GNU General Public License as published by | ||
77 | 6 | # the Free Software Foundation; version 2 of the License. | ||
78 | 7 | # | ||
79 | 8 | # This program is distributed in the hope that it will be useful, | ||
80 | 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
81 | 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
82 | 11 | # GNU General Public License for more details. | ||
83 | 12 | # | ||
84 | 13 | # You should have received a copy of the GNU General Public License | ||
85 | 14 | # along with this program; if not, write to the Free Software | ||
86 | 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
87 | 16 | |||
88 | 17 | . /lib/svc/share/smf_include.sh | ||
89 | 18 | |||
90 | 19 | prefix=@prefix@ | ||
91 | 20 | exec_prefix=@exec_prefix@ | ||
92 | 21 | datadir=`svcprop -p drizzle/datadir $SMF_FMRI` | ||
93 | 22 | |||
94 | 23 | case "$1" in | ||
95 | 24 | 'start') | ||
96 | 25 | /bin/coreadm -p "`svcprop -p drizzle/corepattern $SMF_FMRI`" $$ | ||
97 | 26 | @sbindir@/drizzled --datadir=`eval echo ${datadir}` \ | ||
98 | 27 | --port=`svcprop -p drizzle/port $SMF_FMRI` \ | ||
99 | 28 | --skip-stack-trace & | ||
100 | 29 | ;; | ||
101 | 30 | |||
102 | 31 | 'stop') | ||
103 | 32 | smf_kill_contract $2 TERM 1 | ||
104 | 33 | ;; | ||
105 | 34 | |||
106 | 35 | *) | ||
107 | 36 | echo "Usage: $0 {start|stop}" | ||
108 | 37 | exit 1 | ||
109 | 38 | ;; | ||
110 | 39 | esac | ||
111 | 40 | |||
112 | 41 | exit $SMF_EXIT_OK | ||
113 | 0 | 42 | ||
114 | === added file 'support-files/smf/drizzle.xml.in' | |||
115 | --- support-files/smf/drizzle.xml.in 1970-01-01 00:00:00 +0000 | |||
116 | +++ support-files/smf/drizzle.xml.in 2009-05-18 17:46:43 +0000 | |||
117 | @@ -0,0 +1,71 @@ | |||
118 | 1 | <?xml version="1.0"?> | ||
119 | 2 | <!-- | ||
120 | 3 | Copyright (C) 2009 Sun Microsystems | ||
121 | 4 | |||
122 | 5 | This program is free software; you can redistribute it and/or modify | ||
123 | 6 | it under the terms of the GNU General Public License as published by | ||
124 | 7 | the Free Software Foundation; version 2 of the License. | ||
125 | 8 | |||
126 | 9 | This program is distributed in the hope that it will be useful, | ||
127 | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
128 | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
129 | 12 | GNU General Public License for more details. | ||
130 | 13 | |||
131 | 14 | You should have received a copy of the GNU General Public License | ||
132 | 15 | along with this program; if not, write to the Free Software | ||
133 | 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
134 | 17 | --> | ||
135 | 18 | <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> | ||
136 | 19 | <service_bundle type="manifest" name="drizzle"> | ||
137 | 20 | <service name="application/database/drizzle" type="service" version="1"> | ||
138 | 21 | <single_instance/> | ||
139 | 22 | |||
140 | 23 | <dependency name="multi-user-server" grouping="require_all" restart_on="none" type="service"> | ||
141 | 24 | <service_fmri value="svc:/milestone/multi-user-server" /> | ||
142 | 25 | </dependency> | ||
143 | 26 | |||
144 | 27 | |||
145 | 28 | <!-- We need to map the name of the authorizations we defined to this service --> | ||
146 | 29 | <property_group name="general" type="framework"> | ||
147 | 30 | <propval name="action_authorization" type="astring" | ||
148 | 31 | value="solaris.smf.manage.drizzle" /> | ||
149 | 32 | <propval name="value_authorization" type="astring" | ||
150 | 33 | value="solaris.smf.value.drizzle" /> | ||
151 | 34 | </property_group> | ||
152 | 35 | |||
153 | 36 | |||
154 | 37 | <property_group name="drizzle" type="application"> | ||
155 | 38 | <propval name="datadir" type="astring" | ||
156 | 39 | value="@localstatedir@/data" /> | ||
157 | 40 | <propval name="corepattern" type="astring" | ||
158 | 41 | value="@localstatedir@/crash/core.%f.%p" /> | ||
159 | 42 | <propval name="port" type="astring" | ||
160 | 43 | value="4427" /> | ||
161 | 44 | </property_group> | ||
162 | 45 | |||
163 | 46 | <!-- Define the instance and how to start / stop it --> | ||
164 | 47 | <instance name="drizzle" enabled="false"> | ||
165 | 48 | <exec_method type="method" name="start" exec="/lib/svc/method/drizzle start" timeout_seconds="30" > | ||
166 | 49 | <method_context> | ||
167 | 50 | <method_credential user="drizzled" group="drizzled" /> | ||
168 | 51 | </method_context> | ||
169 | 52 | </exec_method> | ||
170 | 53 | <exec_method type="method" name="stop" exec="/lib/svc/method/drizzle stop %{restarter/contract}" timeout_seconds="60" > | ||
171 | 54 | <method_context> | ||
172 | 55 | <method_credential user="drizzled" group="drizzled" /> | ||
173 | 56 | </method_context> | ||
174 | 57 | </exec_method> | ||
175 | 58 | </instance> | ||
176 | 59 | |||
177 | 60 | |||
178 | 61 | <stability value="Unstable" /> | ||
179 | 62 | <template> | ||
180 | 63 | <common_name> | ||
181 | 64 | <loctext xml:lang="C">Drizzle database server</loctext> | ||
182 | 65 | </common_name> | ||
183 | 66 | <documentation> | ||
184 | 67 | <manpage title="drizzle" section="1" manpath="@prefix@/share/man" /> | ||
185 | 68 | </documentation> | ||
186 | 69 | </template> | ||
187 | 70 | </service> | ||
188 | 71 | </service_bundle> | ||
189 | 0 | 72 | ||
190 | === added file 'support-files/smf/install.sh.in' | |||
191 | --- support-files/smf/install.sh.in 1970-01-01 00:00:00 +0000 | |||
192 | +++ support-files/smf/install.sh.in 2009-05-18 17:46:43 +0000 | |||
193 | @@ -0,0 +1,103 @@ | |||
194 | 1 | #! /bin/pfsh | ||
195 | 2 | # Copyright (C) 2009 Sun Microsystems | ||
196 | 3 | # | ||
197 | 4 | # This program is free software; you can redistribute it and/or modify | ||
198 | 5 | # it under the terms of the GNU General Public License as published by | ||
199 | 6 | # the Free Software Foundation; version 2 of the License. | ||
200 | 7 | # | ||
201 | 8 | # This program is distributed in the hope that it will be useful, | ||
202 | 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
203 | 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
204 | 11 | # GNU General Public License for more details. | ||
205 | 12 | # | ||
206 | 13 | # You should have received a copy of the GNU General Public License | ||
207 | 14 | # along with this program; if not, write to the Free Software | ||
208 | 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
209 | 16 | |||
210 | 17 | prefix=@prefix@ | ||
211 | 18 | exec_prefix=@exec_prefix@ | ||
212 | 19 | |||
213 | 20 | grep solaris.smf.value.drizzle /etc/security/auth_attr > /dev/null | ||
214 | 21 | if [ $? -ne 0 ] | ||
215 | 22 | then | ||
216 | 23 | ed /etc/security/auth_attr <<EOF | ||
217 | 24 | a | ||
218 | 25 | solaris.smf.value.drizzle:::Change Drizzle value properties:: | ||
219 | 26 | solaris.smf.manage.drizzle:::Manage Drizzle service states:: | ||
220 | 27 | . | ||
221 | 28 | w | ||
222 | 29 | q | ||
223 | 30 | EOF | ||
224 | 31 | if [ $? -ne 0 ] | ||
225 | 32 | then | ||
226 | 33 | echo "Failed to add authorization definitions" | ||
227 | 34 | exit 1 | ||
228 | 35 | fi | ||
229 | 36 | fi | ||
230 | 37 | |||
231 | 38 | grep solaris.smf.manage.drizzle /etc/security/prof_attr > /dev/null | ||
232 | 39 | if [ $? -ne 0 ] | ||
233 | 40 | then | ||
234 | 41 | ed /etc/security/prof_attr <<EOF | ||
235 | 42 | a | ||
236 | 43 | Drizzle Administration::::auths=solaris.smf.manage.drizzle,solaris.smf.value.drizzle | ||
237 | 44 | . | ||
238 | 45 | w | ||
239 | 46 | q | ||
240 | 47 | EOF | ||
241 | 48 | |||
242 | 49 | if [ $? -ne 0 ] | ||
243 | 50 | then | ||
244 | 51 | echo "Failed to add profile definitions" | ||
245 | 52 | exit 1 | ||
246 | 53 | fi | ||
247 | 54 | fi | ||
248 | 55 | |||
249 | 56 | getent group drizzled > /dev/null | ||
250 | 57 | if [ $? -ne 0 ] | ||
251 | 58 | then | ||
252 | 59 | groupadd drizzled | ||
253 | 60 | if [ $? -ne 0 ] | ||
254 | 61 | then | ||
255 | 62 | echo "Failed to create group drizzled" | ||
256 | 63 | exit 1 | ||
257 | 64 | fi | ||
258 | 65 | fi | ||
259 | 66 | |||
260 | 67 | getent passwd drizzled > /dev/null | ||
261 | 68 | if [ $? -ne 0 ] | ||
262 | 69 | then | ||
263 | 70 | roleadd -c "Drizzle daemon" -d @localstatedir@ -g drizzled \ | ||
264 | 71 | -A solaris.smf.value.drizzle,solaris.smf.manage.drizzle drizzled | ||
265 | 72 | if [ $? -ne 0 ] | ||
266 | 73 | then | ||
267 | 74 | echo "Failed to create role drizzled" | ||
268 | 75 | exit 1 | ||
269 | 76 | fi | ||
270 | 77 | |||
271 | 78 | mkdir -p @localstatedir@/data | ||
272 | 79 | mkdir -p @localstatedir@/crash | ||
273 | 80 | chown -R drizzled:drizzled @localstatedir@ | ||
274 | 81 | fi | ||
275 | 82 | |||
276 | 83 | /usr/sbin/install -f /lib/svc/method drizzle | ||
277 | 84 | if [ $? -ne 0 ] | ||
278 | 85 | then | ||
279 | 86 | echo "Failed to install smf startup script" | ||
280 | 87 | exit 1 | ||
281 | 88 | fi | ||
282 | 89 | |||
283 | 90 | /usr/sbin/install -f /var/svc/manifest/application -m 0444 drizzle.xml | ||
284 | 91 | if [ $? -ne 0 ] | ||
285 | 92 | then | ||
286 | 93 | echo "Failed to install smf definition" | ||
287 | 94 | exit 1 | ||
288 | 95 | fi | ||
289 | 96 | |||
290 | 97 | svccfg import /var/svc/manifest/application/drizzle.xml | ||
291 | 98 | if [ $? -ne 0 ] | ||
292 | 99 | then | ||
293 | 100 | echo "Failed to import smf definition" | ||
294 | 101 | exit 1 | ||
295 | 102 | fi | ||
296 | 103 |
Added configuration files (and a script to install them) needed to run drizzle as a service in SMF.