]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mworker: unregister the signals of main()
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 20 Nov 2018 16:36:53 +0000 (17:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Nov 2018 10:42:51 +0000 (11:42 +0100)
The signal_register_fct() does not remove the handlers assigned to a
signal, but add a new handler to a list.

We accidentality inherited the handlers of the main() function in the
master process which is a problem because they act on the proxies.

The side effect was to stop the MASTER proxy which handle the master CLI
on a SIGUSR1, and to display some debug info when doing a SIGHUP and a
SIGQUIT.

src/haproxy.c

index 6a1397a87904d95c43581c4841162da333d0c8f6..79de01b0618922e8c0d352b0dc33fcf1e86cd59d 100644 (file)
@@ -862,6 +862,10 @@ static void mworker_loop()
 
        master = 1;
 
+       signal_unregister(SIGUSR1);
+       signal_unregister(SIGHUP);
+       signal_unregister(SIGQUIT);
+
        signal_register_fct(SIGTERM, mworker_catch_sigterm, SIGTERM);
        signal_register_fct(SIGUSR1, mworker_catch_sigterm, SIGUSR1);
        signal_register_fct(SIGINT, mworker_catch_sigterm, SIGINT);