Date: Thu, 10 Aug 2017 16:46:17 +0100 From: Matthew Seaman <matthew@FreeBSD.org> To: freebsd-ports@freebsd.org Subject: Re: FreeBSD Port: haproxy-1.7.8 Message-ID: <a16b4ad7-46a6-06be-a6da-d5604ac291a2@FreeBSD.org> In-Reply-To: <01ae2c2e-4d1f-df7d-b7c7-8b9677ce961e@inbox.ru> References: <01ae2c2e-4d1f-df7d-b7c7-8b9677ce961e@inbox.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WegiD1PPPA5GXGXXoj4xjxk3cexNdt6Ta Content-Type: multipart/mixed; boundary="8XUX2cwEpRKeVXgWbXmvFMSAGqDIPQJoO"; protected-headers="v1" From: Matthew Seaman <matthew@FreeBSD.org> To: freebsd-ports@freebsd.org Message-ID: <a16b4ad7-46a6-06be-a6da-d5604ac291a2@FreeBSD.org> Subject: Re: FreeBSD Port: haproxy-1.7.8 References: <01ae2c2e-4d1f-df7d-b7c7-8b9677ce961e@inbox.ru> In-Reply-To: <01ae2c2e-4d1f-df7d-b7c7-8b9677ce961e@inbox.ru> --8XUX2cwEpRKeVXgWbXmvFMSAGqDIPQJoO Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 10/08/2017 15:29, Alan Makoev via freebsd-ports wrote: > Hello FreeBSD team! > I installed haproxy and found that it's rc script ignores pidfile set i= n > rc.d. I suppose this is because these lines: >=20 > : ${haproxy_enable:=3D"NO"} > : ${haproxy_config:=3D"%%PREFIX%%/etc/${name}.conf"} > pidfile=3D${haproxy_pidfile:-"/var/run/haproxy.pid"} >=20 > precede this one: >=20 > load_rc_config $name >=20 > As a result, haproxy_enable and haproxy_config are redefined when > loading config, but pidfile keeps the default value. No, this is a common shell idiom for providing a default value ${foo:-"default setting"} will resolve to either the value of ${foo} or -- iff ${foo} is unset or null -- then "default setting" will be used instead. The form: : ${foo:=3D"default setting"} is similar, but difference is that it /sets/ the value of ${foo} to "default setting" if ${foo} is not already initialised. The leading ':' is a do-nothing command in /bin/sh -- otherwise the shell would attempt to run whatever setting ${foo} ended up with as a command, which would undoubtedly fail. These are used without exception in every single rc.conf init file, so we're pretty sure it works exactly as intended. You need to put text like this haproxy_pidfile=3D"/some/pidfile/location" into your /etc/rc.conf Note that, depending on the software concerned, having a pidfile defined in the haproxy.conf file may or may not override a setting given on the command line by the rc.conf script, so make sure both of those are in agreement to avoid confusion. Cheers, Matthew --8XUX2cwEpRKeVXgWbXmvFMSAGqDIPQJoO-- --WegiD1PPPA5GXGXXoj4xjxk3cexNdt6Ta Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJZjH/KXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATVN0P/2PKNrei1ccsqqvxyC8Wf1S2 tbbd/HgfskkCjJGPZUS0NhOv4ZrOQaSh5FaOT6r5o1+6YjqKq0YdzV8nolhYUi7r wf5VQVLhdDvqc26WUic+8ou3YogHopIMPuJeCVnPKV5Doek6NkG83YDy/Fs3sYd8 qrhrqDZaq3V38s03YdPgiQheWZXuqKYiWfiBvrjVSsuLWNEg5Y/akNffgkM1w6OG ckeJiKXu1Uurd4ZJa9ED2WLz5snxrx0c9Z/xtav5Vt4eMY1BTNowojRngrpTAypD TG4TPK13OVv/qDYwYqNChkhSLCGu16SXt+KYsAI8r2hYiqfnz5cTWM26lAZBX0JS v6S/pwW/QoQrevstw6vvF4eUP/poB+Yek8N9Mfu4Lu4T9U9oTu0XMbA47lUjBm/n H3gkXvcgaqtJ2UqSmZY2e975BPjw/xu1lstidVyNYGOLiuDHlutTd6clbZTHlhPH U1yyW8TD9V9KIRpes//GMtq/EJtQwF4qPQ6PY72RazFS7wjvptXfUyvVPn/xECrC wr3ucedj7ahV7qv39vU0wEHJqQaccVXTRPdD4BUYy3UjWer+Ayp+SnltvQeC0eed S+bimo1P6Us9p/AxH37mmloC7V9dNCA40oaQJF+zp8Xpt+pEmtlw6pHmUawn1w9+ XXyXrllAjCFqSPSfwtjQ =sHLW -----END PGP SIGNATURE----- --WegiD1PPPA5GXGXXoj4xjxk3cexNdt6Ta--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a16b4ad7-46a6-06be-a6da-d5604ac291a2>