]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: mworker: handle reload and signals
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 1 Jun 2017 15:38:51 +0000 (17:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Jun 2017 08:56:32 +0000 (10:56 +0200)
commit73b85e75b3963086be889e1fb40a59e7ef2ad63b
treebe5723f5c0e54e00e44d1ec1fd7fca747dd4f786
parent095ba4c2428ec8bcccb134b3d24f07de2aabbdcd
MEDIUM: mworker: handle reload and signals

The master-worker will reload itself on SIGUSR2/SIGHUP

It's inherited from the systemd wrapper, when the SIGUSR2 signal is
received, the master process will reexecute itself with the -sf flag
followed by the PIDs of the children.

In the systemd wrapper, the children were using a pipe to notify when
the config has been parsed and when the new process is ready. The goal
was to ensure that the process couldn't reload during the parsing of the
configuration, before signals were send to old process.

With the new mworker model, the master parses the configuration and is
aware of all the children. We don't need a pipe, but we need to block
those signals before the end of a reload, to ensure that the process
won't be killed during a reload.

The SIGUSR1 signal is forwarded to the children to soft-stop HAProxy.

The SIGTERM and SIGINT signals are forwarded to the children in order to
terminate them.
src/haproxy.c
src/signal.c