]> git.kaiwu.me - haproxy.git/commit
MEDIUM: add haproxy-systemd-wrapper
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Tue, 12 Feb 2013 09:53:53 +0000 (10:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 Feb 2013 09:47:56 +0000 (10:47 +0100)
commited9803e606f25d906115f7e3e130b92197f8608e
treeb223327776755b70d854410274e8b008eb4d2c6b
parent992709bad06be0ee710ac60b169b18a7607b71b5
MEDIUM: add haproxy-systemd-wrapper

Currently, to reload haproxy configuration, you have to use "-sf".

There is a problem with this way of doing things. First of all, in the systemd world,
reload commands should be "oneshot" ones, which means they should not be the new main
process but rather a tool which makes a call to it and then exits. With the current approach,
the reload command is the new main command and moreover, it makes the previous one exit.
Systemd only tracks the main program, seeing it ending, it assumes it either finished or failed,
and kills everything remaining as a grabage collector. We then end up with no haproxy running
at all.

This patch adds wrapper around haproxy, no changes at all have been made into it,
so it's not intrusive and doesn't change anything for other hosts. What this wrapper does
is basically launching haproxy as a child, listen to the SIGUSR2 (not to conflict with
haproxy itself) signal, and spawing a new haproxy with "-sf" as a child to relay the
first one.

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
.gitignore
Makefile
src/haproxy-systemd-wrapper.c [new file with mode: 0644]