taskd.pl: avoid spurious SIGCHLD from jobd restarter
commitbda4414fe705a876eae5915e7ad4fcc45c95690c
authorKyle J. McKay <mackyle@gmail.com>
Mon, 28 Nov 2016 00:45:18 +0000 (27 16:45 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 28 Nov 2016 00:45:18 +0000 (27 16:45 -0800)
tree1e64948fb720416cce9dcf52c5c8bbdde24467d8
parent471a64ae65b5b944395dceb550542186bf6b507d
taskd.pl: avoid spurious SIGCHLD from jobd restarter

Make sure that any SIGCHLD generated as a result of scheduling and/or
cancelling the jobd.pl restarter process do not interfere with normal
taskd child tracking activities.

This is accomplished by 1) temporarily changing $SIG{CHLD} in some
places 2) making sure to waitpid for any outstanding children related
to scheduling/cancelling the jobd restarter and 3) double-forking the
jobd.pl restarter child so that when it finally does its thing it
does not generate a SIGCHLD back to the taskd.pl process.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
taskd/taskd.pl