]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: signal: register default handler for SIGINT in signal_init()
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Mon, 2 Dec 2024 13:47:17 +0000 (14:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Dec 2024 16:28:04 +0000 (17:28 +0100)
commitd3c20b02469dea6f46369bb91965d8b4924bb2b7
tree86c779426c81ed5bf2066ce3880a90eeac65ffbd
parent70b5cd67948e2e70be5d373aa2b843fdd2ff8fdf
BUG/MINOR: signal: register default handler for SIGINT in signal_init()

When haproxy is launched in a background and in a subshell (see example below),
according to POSIX standard (2.11. Signals and Error Handling), it inherits
from the subshell SIG_IGN signal handler for SIGINT and SIGQUIT.

$ (./haproxy -f env4.cfg &)

So, when haproxy is lanched like this, it doesn't stop upon receiving
the SIGINT. This can be a root cause of some unexpected timeouts, when haproxy
is started under VTest, as VTest sends to the process SIGINT in order to
terminate it. To fix this, let's explicitly register the default signal
handler for the SIGINT in signal_init() initcall.

This should be backported in all stable versions.
src/signal.c