eventscript: don't do debugging system() from inside signal handler
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 8 Apr 2010 05:43:29 +0000 (15:13 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 8 Apr 2010 05:43:29 +0000 (15:13 +0930)
commit7ee5ecc8d53e78e2dec21197b74a74cc4ae1834c
tree9cc6c9400d707cb615ba2d79a5abf611ae1bdaeb
parentfcc63e04beb427c1f48deae6d3d98c78a2a67949
eventscript: don't do debugging system() from inside signal handler

In the case of a timeout, we dump a log of what's happening to a file
in /tmp.  We do it from the signal handler, which is an unreliable hack
(BZ58365).

Instead, create another (lower-priority) child to do the dump, then
kill the timedout script.

Note that this doesn't quite work as intended (the dump is often run
after the script has been killed), so the next patch resolves this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
common/ctdb_util.c
include/ctdb_private.h
server/eventscript.c