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
This is a multi-part message in MIME format. --------------060007020707090208010703 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----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----- --------------060007020707090208010703 Content-Type: text/plain; name="mysql-proxy-patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mysql-proxy-patch.txt" 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 --------------060007020707090208010703 Content-Type: application/octet-stream; name="mysql-proxy-patch.txt.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="mysql-proxy-patch.txt.sig" iQEcBAABAgAGBQJOf+4FAAoJEPXPYrMgexuh2awH/RAD+3DmhLwjKaR9Uim8vjtWbyZIQ5zs SQ+tmvcifHLqJ6P69bGhzSQwMPNl9woCaUZkBIGjt2nFKKHPPFbwLSYC8ZHr4t/nrm/cRs6R ZodtCQhbpedllB4kQRRihIqbBvz8Yfb6FITVeaEbvyf6r9tnpQ3PSShX4Xc4djcduxSFBfo9 8dxi1R3deu9VifIvIAHsJfSNZ7kbp34pE6jm7cduKunvTZx0RfZlsMWDOqCenEQuLmEwmRs+ vUDN12nAWIwtitGw9nn8kr5QmFe/aU78KyQfGxAoZko1yEwjhgXX4JF+ESVsEmf96094XC7D pVeV/SorO1klPejM3YHYuy4= --------------060007020707090208010703--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E7FEE06.9050305>