]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: systemd: set KillMode to 'mixed'
authorApollon Oikonomopoulos <apoikos@debian.org>
Wed, 8 Oct 2014 12:14:41 +0000 (15:14 +0300)
committerWilly Tarreau <w@1wt.eu>
Thu, 9 Oct 2014 09:44:42 +0000 (11:44 +0200)
By default systemd will send SIGTERM to all processes in the service's
control group. In our case, this includes the wrapper, the master
process and all worker processes.

Since commit c54bdd2a the wrapper actually catches SIGTERM and survives
to see the master process getting killed by systemd and regard this as
an error, placing the unit in a failed state during "systemctl stop".

Since the wrapper now handles SIGTERM by itself, we switch the kill mode
to 'mixed', which means that systemd will deliver the initial SIGTERM to
the wrapper only, and if the actual haproxy processes don't exit after a
given amount of time (default: 90s), a SIGKILL is sent to all remaining
processes in the control group. See systemd.kill(5) for more
information.

This should also be backported to 1.5.

contrib/systemd/haproxy.service.in

index 1a3d2c050f49881ef6121229e445207dca0e7697..0bc54204226693f523521cef474e0d147ccf4afa 100644 (file)
@@ -5,6 +5,7 @@ After=network.target
 [Service]
 ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
 ExecReload=/bin/kill -USR2 $MAINPID
+KillMode=mixed
 Restart=always
 
 [Install]