byjg / docker-easy-haproxy

Discover services and create dynamically the haproxy.cfg based on the labels defined in docker containers or from a simple static Yaml
MIT License
56 stars 13 forks source link

correct the path to haproxy - should be /usr/sbin/haproxy #9

Closed dtenenba closed 3 years ago

dtenenba commented 3 years ago

The script assets/scripts/haproxy-reload.sh had the incorrect path to haproxy: /usr/local/sbin/haproxy but in fact haproxy is located at /usr/sbin/haproxy in the container. As a result of the incorrect path, haproxy was not being reloaded when a new stack was added or an existing one was removed.

(An unrelated note - it looks like the docker image at byjg/easy-haproxy is not built from the current Dockerfile in this repository. That container does not start supervisord or cron, so when you run it, it does not detect new services coming up or going down).

byjg commented 3 years ago

Hi, thank you for your PR, you're right, the code is pointing to the wrong path.

I am approving this PR and merging it.

About your comment you can't see the supervisor, I ran locally a test and everything is OK.

jg@local ~/ $ docker pull byjg/easy-haproxy 
Using default tag: latest
latest: Pulling from byjg/easy-haproxy
f0eabd2439ac: Already exists 
6cfb9ad65834: Pull complete 
Digest: sha256:bc5e13bbe53c29e8e35db18424e0a9c38eccbdaec7b680a25c197f580b0fb371
Status: Downloaded newer image for byjg/easy-haproxy:latest
docker.io/byjg/easy-haproxy:latest

jg@local ~/ $ docker run --rm byjg/easy-haproxy 

2021-10-21 04:38:34,347 INFO Set uid to user 0 succeeded
2021-10-21 04:38:34,350 INFO RPC interface 'supervisor' initialized
2021-10-21 04:38:34,351 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2021-10-21 04:38:34,351 INFO supervisord started with pid 1
2021-10-21 04:38:35,355 INFO spawned: 'exit_on_any_fatal' with pid 6
2021-10-21 04:38:35,362 INFO spawned: 'haproxy' with pid 7
2021-10-21 04:38:35,370 INFO spawned: 'crond' with pid 8
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Initial configuration
[NOTICE]   (42) : New worker #1 (43) forked
2021-10-21 04:38:36,535 INFO success: exit_on_any_fatal entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-10-21 04:38:36,536 INFO success: haproxy entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-10-21 04:38:36,536 INFO success: crond entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
c
dtenenba commented 3 years ago

Thanks. I tried running the image again and it does run crond. Not sure what was happening earlier. Thanks for merging!

byjg commented 3 years ago

Release tag 3.0.1