]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: startup: move daemonization fork in init
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Fri, 28 Jun 2024 16:06:52 +0000 (18:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:00:58 +0000 (22:00 +0200)
commit90b8181c0a5a9a08b1fa2e77ebe28896fd2a9237
tree0ad14b777c5cf1ebdd768ee8573aa185fa32ebc5
parentdf12791da3bff0c63d37effba62e34722b72d3e8
MEDIUM: startup: move daemonization fork in init

Let's move daemonization fork in init(). We need to perform this fork always
before forking a worker process, in order to be able to launch master and then
its worker in daemon, i.e. background mode, if haproxy was started with '-D'
option.

This refactoring is a preparation step, needed for replacing then master-worker
fork in init() as well. This allows the master process not to read the whole
configuration file and not to do re-execution in order to free additional
memory, when worker was forked. In the new refactored design only the worker
process will read and apply a new configuration, while the master will arrive
very fast in its polling loop to wait worker's termination and to handle
signals. See more details in the following commits.
src/haproxy.c