haproxy/contrib
Tim Duesterhus d6942c8297 MEDIUM: mworker: Add systemd Type=notify support
This patch adds support for `Type=notify` to the systemd unit.

Supporting `Type=notify` improves both starting as well as reloading
of the unit, because systemd will be let known when the action completed.

See this quote from `systemd.service(5)`:
> Note however that reloading a daemon by sending a signal (as with the
> example line above) is usually not a good choice, because this is an
> asynchronous operation and hence not suitable to order reloads of
> multiple services against each other. It is strongly recommended to
> set ExecReload= to a command that not only triggers a configuration
> reload of the daemon, but also synchronously waits for it to complete.

By making systemd aware of a reload in progress it is able to wait until
the reload actually succeeded.

This patch introduces both a new `USE_SYSTEMD` build option which controls
including the sd-daemon library as well as a `-Ws` runtime option which
runs haproxy in master-worker mode with systemd support.

When haproxy is running in master-worker mode with systemd support it will
send status messages to systemd using `sd_notify(3)` in the following cases:

- The master process forked off the worker processes (READY=1)
- The master process entered the `mworker_reload()` function (RELOADING=1)
- The master process received the SIGUSR1 or SIGTERM signal (STOPPING=1)

Change the unit file to specify `Type=notify` and replace master-worker
mode (`-W`) with master-worker mode with systemd support (`-Ws`).

Future evolutions of this feature could include making use of the `STATUS`
feature of `sd_notify()` to send information about the number of active
connections to systemd. This would require bidirectional communication
between the master and the workers and thus is left for future work.
2017-11-20 18:39:41 +01:00
..
base64 [CONTRIB] add base64rev-gen.c that was used to generate the base64rev table. 2010-01-31 19:14:07 +01:00
debug MINOR: debug/flags: Add missing flags 2017-11-13 11:38:14 +01:00
halog BUG/MINOR: contrib/halog: fixing small memory leak 2017-10-03 13:52:45 +02:00
hpack CONTRIB: hpack: implement a reverse huffman table generator for hpack 2017-10-31 18:03:24 +01:00
ip6range BUILD: contrib: fix ip6range build on Centos 7 2016-11-22 11:50:51 +01:00
iprange MINOR: contrib: make the iprange tool grep for addresses 2012-12-13 00:11:02 +01:00
mod_defender BUG/MINOR: contrib/mod_defender: close the va_list argp before return 2017-09-18 11:18:09 +02:00
modsecurity BUG/MINOR: contrib/modsecurity: close the va_list ap before return 2017-09-18 11:18:34 +02:00
netsnmp-perl [CONTRIB] Update Cacti Tempates 2010-10-30 19:04:36 +02:00
plug_qdisc CONTRIB: plug qdiscs: Plug queuing disciplines mini HOWTO. 2017-06-14 16:22:34 +02:00
selinux
spoa_example BUG/MINOR: spoa: Update pointer on the end of the frame when a reply is encoded 2017-10-31 11:36:12 +01:00
systemd MEDIUM: mworker: Add systemd Type=notify support 2017-11-20 18:39:41 +01:00
tcploop CONTRIB: tcploop: add action "X" to execute a command 2017-05-03 06:58:53 +02:00
trace CONTRIB: trace: report the base name only for file names 2017-10-24 19:54:25 +02:00
wireshark-dissectors/peers CONTRIB: Wireshark dissector for HAProxy Peer Protocol. 2017-11-15 19:49:41 +01:00