LP1204123 Set SIGCHLD handler to DEFAULT for children (perl)
authorBill Erickson <berick@esilibrary.com>
Wed, 26 Jun 2013 18:51:52 +0000 (14:51 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 23 Jul 2013 14:41:41 +0000 (10:41 -0400)
Remove the special SIGCHLD handler applied to the parent/listener
process from spawned child processes (drones) by setting child handler to
DEFAULT.  Otherwise, if an OpenSRF drone process spawns a sub-process,
the drone will execute the SIGCHLD handler meant for the Listener when
the sub-process dies, wherein hijinks ensue.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
src/perl/lib/OpenSRF/Server.pm

index d8103b6..1257a9c 100644 (file)
@@ -449,7 +449,7 @@ sub spawn_child {
 
     } else { # child process
 
-        $SIG{$_} = 'DEFAULT' for (qw/INT TERM QUIT HUP/);
+        $SIG{$_} = 'DEFAULT' for (qw/INT TERM QUIT HUP CHLD/);
 
         if($self->{stderr_log}) {