BUG/MEDIUM: mworker: report status, if daemonized master fails
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Mon, 9 Dec 2024 17:56:01 +0000 (18:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 10 Dec 2024 10:09:53 +0000 (11:09 +0100)
commit24c63afbd2a4efa53a7106ba5200da49c21f03e0
treef88c98800edc034b6ca54f5260abd54228829dbf
parent36cbc7e536e265da8f45e230739fca635760512e
BUG/MEDIUM: mworker: report status, if daemonized master fails

As daemonization fork happens now very early and before the master-worker
fork, if master or worker processes fail during the initialization, some
critical errors can't be reported to stdout. The launching (parent) process in
such cases exits with 0. This makes an impression, that master and his worker
have successfully started at background, which really complicates the
operations.

In the previous commit a pipe was added to make daemonized child communicate
with his parent. Let's add the same logic to master-worker mode. Up to
receiving the READY message from the worker, master will "forward" it via the
pipe to the launching process. Launching process can obtain master's exit
status, if the master fails to start and nothing has been written in the pipe.

This fix should be backported only in 3.1.

(cherry picked from commit 97aaf7671654ceba16727f8375104064538c40e6)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/cli.c
src/mworker.c