HAProxyContext: deploy configs that work at boot time on trusty #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
admin.sock was added to the default config file so that haproxy
would always start, even without any listeners defined, which
prevents systemd from marking the unit as failed[1]. On xenial,
/var/run/haproxy is created at boot time by the init script,
since /var/run (really /run) is a tmpfs. On trusty, this seems
to work, because the charm also creates /var/run/haproxy, but
since the trusty init script does not create /var/run/haproxy,
following a reboot, haproxy will not start until charm hooks have
run and created the missing directory. Since the admin socket
does not otherwise exist on trusty haproxy deploys, and we already
create a stats listener on 127.0.0.1:8888, the simplest thing to
do is to only add the directive if may be expected or needed.
Fixes: https://bugs.launchpad.net/charm-helpers/+bug/1755061
Footnotes:
1: https://anonscm.debian.org/cgit/pkg-haproxy/haproxy.git/commit/?id=8b77d5e324bb11466a3e10cd4885234f9cbf8a61