]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: startup: fix pidfile creation
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Mon, 2 Dec 2024 15:05:16 +0000 (16:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Dec 2024 16:28:04 +0000 (17:28 +0100)
commit295071007b1bf83eb0d66ad88b05d6aef05c69eb
treee43bc9973f5e1b30386052a475f437af1a51f7b6
parenta33977da48978299d2d71403593846b1b21ec768
BUG/MINOR: startup: fix pidfile creation

Pidfile should be created at the latest initialization stage, when we are
sure, that process is able to start successfully, otherwise PID value, written
in this file is no longer valid.

So, for the standalone mode, let's move the block, which opens the pidfile and
let's put it just before applying "chroot". In master-worker mode, master
doesn't perform chroot. So it creates the pidfile, only when the "READY"
message from the newly forked worker is received.

This should be backported only in 3.1
src/cli.c
src/haproxy.c