Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAProxyContext: deploy configs that work at boot time on trusty #130

Closed
wants to merge 2 commits into from

Conversation

faebd7
Copy link
Contributor

@faebd7 faebd7 commented Mar 13, 2018

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

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
@javacruft
Copy link
Collaborator

Should be fixed in the haproxy packaging in trusty rather than the charm (as discussed in the bug report)

@javacruft javacruft closed this May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants