❦  4 février 2020 17:17 +00, Chris Hide <chris.h...@mdsl.com>:

> I believe there is an inconsistency in the location of the PID file.
> In /lib/systemd/system/haproxy.service the PID file is /run/haproxy.pid.
> In /etc/init.d/haproxy the PID file is /var/run/${BASENAME}.pid.

That's the same file. /var/run should be a symlink to /run.

> This means that when someone runs the init script to reload the
> haproxy config the old process keeps running with the old config.
> Also if anyone follows the HAProxy documentation and runs the reload
> command the old process will keep running with the old config.
>
> See http://cbonte.github.io/haproxy-dconv/2.0/management.html#3
> A safe way to start HAProxy from an init file consists in forcing the daemon
> mode, storing existing pids to a pid file and using this pid file to notify
> older processes to finish before leaving :
>
>    haproxy -f /etc/haproxy.cfg \
>            -D -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)
>
> I suggest that the PID file location be set to /var/run/haproxy.pid to
> match the HAProxy documentation and community documentation.

That's what is done in the init script.
-- 
Avoid unnecessary branches.
            - The Elements of Programming Style (Kernighan & Plauger)

Attachment: signature.asc
Description: PGP signature

Reply via email to