Date: Sun, 25 Sep 2011 23:14:14 -0400 From: Steve Wills <swills@FreeBSD.org> To: Doug Barton <dougb@FreeBSD.org> Cc: cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/databases/mysql-proxy Makefile distinfo pkg-plist ports/databases/mysql-proxy/files mysql-proxy.in Message-ID: <4E7FEE06.9050305@FreeBSD.org> In-Reply-To: <4E7EBF4C.90205@FreeBSD.org> References: <201109181958.p8IJwFfZ062133@repoman.freebsd.org> <4E7EBF4C.90205@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
-----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-----
[-- Attachment #2 --]
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 #3 --]
N
b {٬p愼#)}R);Vo&HCI"|r'$00e
iFdi(<V-&oFΑfm [e$Abay'g
I(Ww8v7=bzU/ %g~)n*MtEeŃ:D..a0>@iX-ѰyPWiN+$(fJ5L#~%lgOx\.åW*+;Y%=݁ػ.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E7FEE06.9050305>
