cvs commit: ports/databases/mysql-proxy Makefile distinfo pkg-plist ports/databases/mysql-proxy/files mysql-proxy.in

Steve Wills swills at FreeBSD.org
Mon Sep 26 03:14:17 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Doug,

On 09/25/11 01:42, Doug Barton wrote:
> Can you wrap the 'for addr in ...' bit in a start_precmd? We prefer not
> to have code run unconditionally in rc.d scripts.
> 

I've tried to do that in the past when you've asked about it previously,
but it always fails in testing for me. When I tried to understand why,
it seemed to be some shell subtlety that involved variables set inside
subroutines not being global in some cases. I've tried it again and
gotten the same results. If you could perhaps suggest a patch I'd be
happy to test. I've attached the patch I used. Here's what I had in rc.conf:

mysql_proxy_enable="YES"
mysql_proxy_backend_addresses="127.0.0.1:3306 127.0.0.1:3307 127.0.0.1:3308"

Unfortunately, with this change, the backend addresses were not passed
to the daemon as args.

Steve
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iQEcBAEBAgAGBQJOf+4FAAoJEPXPYrMgexuhG3gH/037L1VWAUWRx4c89+kMwIf1
oVxMsr0FyaHPULn8WoXBAcTka/KcSWQwf2ZL6cHqs0KBaw5NMy7Ji5p+MVOGEgV8
+WBAQh5TvMFS2Fwj21/28e8v8Mlhcg2rgeRPOHuCF28bDCaJ6E5DU8Ei6qMiqS6I
d/Su/2mPs/OmAi1oSde+EklriI7sCVlWlQWtfG2OfZQMlZR5UsjwX81npB5ge+3v
y0HAou6M8OqFxyyzodXfAdTfLkUmx2gvOfA0JZ8plszXGF2Uo5+ZNSEZEY//t4WP
W6ryk9yBUjXmxKDwFDqhfprizW5K9S3+h31u17rz6CLpOviKKU1c06qVNfoKMPI=
=4lmi
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: files/mysql-proxy.in
===================================================================
RCS file: /home/ncvs/ports/databases/mysql-proxy/files/mysql-proxy.in,v
retrieving revision 1.4
diff -u -r1.4 mysql-proxy.in
--- files/mysql-proxy.in	18 Sep 2011 19:58:15 -0000	1.4
+++ files/mysql-proxy.in	26 Sep 2011 03:08:39 -0000
@@ -37,9 +37,14 @@
 : ${mysql_proxy_backend_addresses="127.0.0.1:3306"}
 : ${mysql_proxy_pid_file="/var/run/mysql-proxy.pid"}
 
-for addr in ${mysql_proxy_backend_addresses}; do
-	proxy_backend_addresses="${proxy_backend_addresses} --proxy-backend-addresses=${addr}"
-done
+start_precmd="${name}_prestart"
+
+mysql_proxy_prestart()
+{
+  for addr in ${mysql_proxy_backend_addresses}; do
+    proxy_backend_addresses="${proxy_backend_addresses} --proxy-backend-addresses=${addr}"
+  done
+}
 
 pidfile="${mysql_proxy_pid_file}"
 command=%%PREFIX%%/libexec/mysql-proxy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mysql-proxy-patch.txt.sig
Type: application/octet-stream
Size: 287 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-ports/attachments/20110926/620515bd/mysql-proxy-patch.txt.obj


More information about the cvs-ports mailing list