Skip to content

Commit 09f3b6b

Browse files
committed
fix(deploy): move HAProxy admin socket to /tmp for correct permissions
The named Docker volume created /var/run/haproxy owned by root:root, preventing the haproxy user (uid 99) from creating the socket file.
1 parent f72cf81 commit 09f3b6b

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

deploy/ansible/roles/app/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
ansible.builtin.shell: |
222222
for i in $(seq 1 10); do
223223
if docker exec rustyip-haproxy sh -c \
224-
'echo "set server app/{{ deploy_target }} state ready" | socat stdio unix:/var/run/haproxy/admin.sock' 2>/dev/null; then
224+
'echo "set server app/{{ deploy_target }} state ready" | socat stdio unix:/tmp/admin.sock' 2>/dev/null; then
225225
echo "admin socket command succeeded on attempt $i"
226226
exit 0
227227
fi
@@ -293,7 +293,7 @@
293293
ansible.builtin.shell: |
294294
for i in $(seq 1 10); do
295295
if docker exec rustyip-haproxy sh -c \
296-
'echo "set server app/{{ current_active }} state ready" | socat stdio unix:/var/run/haproxy/admin.sock' 2>/dev/null; then
296+
'echo "set server app/{{ current_active }} state ready" | socat stdio unix:/tmp/admin.sock' 2>/dev/null; then
297297
echo "admin socket command succeeded on attempt $i"
298298
exit 0
299299
fi

deploy/ansible/roles/app/templates/docker-compose.yml.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ services:
99
- ./haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
1010
- ./haproxy/ipv4_domain.lst:/usr/local/etc/haproxy/ipv4_domain.lst:ro
1111
- ./haproxy/certs:/etc/haproxy/certs:ro
12-
- haproxy_run:/var/run/haproxy
1312
{% if ipv4_domain %}
1413
- ./haproxy/certs-ipv4:/etc/haproxy/certs-ipv4:ro
1514
{% endif %}
@@ -65,7 +64,6 @@ services:
6564
- internal
6665

6766
volumes:
68-
haproxy_run:
6967
db_data_blue:
7068
db_data_green:
7169

deploy/ansible/roles/app/templates/haproxy.cfg.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
global
22
log stderr local0 err
33
maxconn 10000
4-
stats socket /var/run/haproxy/admin.sock mode 660 level admin
4+
stats socket /tmp/admin.sock mode 660 level admin expose-fd listeners
55
# Performance tuning for high-throughput
66
tune.bufsize 16384
77
tune.maxrewrite 1024

0 commit comments

Comments
 (0)