From owner-cvs-all@FreeBSD.ORG Mon Sep 26 03:14:17 2011 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9BAF1065673; Mon, 26 Sep 2011 03:14:16 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mouf.net (unknown [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b2]) by mx1.freebsd.org (Postfix) with ESMTP id A14A88FC08; Mon, 26 Sep 2011 03:14:16 +0000 (UTC) Received: from meatwad.mouf.net (cpe-024-162-230-236.nc.res.rr.com [24.162.230.236]) (authenticated bits=0) by mouf.net (8.14.4/8.14.4) with ESMTP id p8Q3D4L8046827 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NOT); Sun, 25 Sep 2011 23:13:06 -0400 (EDT) (envelope-from swills@FreeBSD.org) Message-ID: <4E7FEE06.9050305@FreeBSD.org> Date: Sun, 25 Sep 2011 23:14:14 -0400 From: Steve Wills User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110531 Thunderbird/3.1.10 MIME-Version: 1.0 To: Doug Barton References: <201109181958.p8IJwFfZ062133@repoman.freebsd.org> <4E7EBF4C.90205@FreeBSD.org> In-Reply-To: <4E7EBF4C.90205@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------060007020707090208010703" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mouf.net [204.109.58.86]); Sun, 25 Sep 2011 23:13:06 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.97.2 at mouf.net X-Virus-Status: Clean 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 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 03:14:17 -0000 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--