signals: re-register SIGCHLD upon reload
authorAlexandre Cassen <acassen@freebox.fr>
Mon, 28 Sep 2009 16:59:54 +0000 (18:59 +0200)
committerAlexandre Cassen <acassen@freebox.fr>
Mon, 28 Sep 2009 16:59:54 +0000 (18:59 +0200)
Vincent Bernat <bernat@luffy.cx> (and Willy) fixed SIGCHLD handler
re-registering issue.

thread_signal_handler is given as first parameter the master thread.
This thread is destroyed and reallocated on reload but the signal
handler was not recreated and therefore was still using the old master
thread. Usually, there is no change because master thread is
reallocated at the same place.

keepalived/check/check_daemon.c
keepalived/vrrp/vrrp_daemon.c

index bbe8e52..f4004f7 100644 (file)
@@ -193,6 +193,7 @@ reload_check_thread(thread * thread_obj)
        /* Reload the conf */
        mem_allocated = 0;
        check_signal_init();
+       signal_set(SIGCHLD, thread_child_handler, master);
        start_check();
 
        /* free backup data */
index f7c14a0..6e731ff 100644 (file)
@@ -212,6 +212,7 @@ reload_vrrp_thread(thread * thread_obj)
        /* Reload the conf */
        mem_allocated = 0;
        vrrp_signal_init();
+       signal_set(SIGCHLD, thread_child_handler, master);
        start_vrrp();
 
        /* free backup data */