-----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-----
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

Attachment: mysql-proxy-patch.txt.sig
Description: Binary data

_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscr...@freebsd.org"

Reply via email to