]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: mworker/cli: close child and parent fds, setup listeners
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Thu, 3 Oct 2024 09:44:04 +0000 (11:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
commitcf150fd73d5ee139d07e5200d4ddef4ebc33a6e2
tree3227ae9ab8ab1fd1927ab4bc2ab92b79fcbbaeec
parent646299fc95a883bb0ecbf4960d14af4c117ef8cb
MEDIUM: mworker/cli: close child and parent fds, setup listeners

Basically, this is the continuation of the previous commits. So, here after the
fork, worker process closes the "master" end of the copied CLI sockpair and
binds its end, ipc_fd[1], to the GLOBAL proxy listener.
mworker_cli_global_proxy_new_listener() guarantees that GLOBAL proxy will be
created, if it wasn't the case before.

Master process, at first, allocates the MASTER proxy, creates master CLI listener
(-S command line option) and reload sockpair and then closes the "worker" end of
the copied CLI sockpair and binds its end, ipc_fd[0], to the created MASTER proxy.

Usage of the new PROC_O_INIT state helps to reduce test conditions to find the
newly forked worker.
src/haproxy.c