X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCron.pm;h=3c9c04fb8bb015a7fb37a5c2cc541c55832fdfc5;hb=5d197c9f7aa2ea796d86aa5473f93956b24cf1b7;hp=9e4bde71e9083c5b5c7e9c45a4522c98251ebb3f;hpb=f3adc82a0299652d929b73c718127fa38571eec5;p=spider.git diff --git a/perl/DXCron.pm b/perl/DXCron.pm index 9e4bde71..3c9c04fb 100644 --- a/perl/DXCron.pm +++ b/perl/DXCron.pm @@ -184,9 +184,10 @@ sub start_connect if (!$pid) { # in child, unset warnings, disable debugging and general clean up from us $^W = 0; -# do "$main::root/perl/Disable_debug.pl"; eval "{ package DB; sub DB {} }"; + $SIG{HUP} = 'IGNORE'; alarm(0); + DXChannel::closeall(); $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT'; exec $prog, $call, 'connect'; dbg('cron', "exec '$prog' failed $!"); @@ -195,6 +196,9 @@ sub start_connect } else { dbg('cron', "can't fork for $prog $!"); } + + # coordinate + sleep(1); } sub spawn @@ -206,9 +210,10 @@ sub spawn if (!$pid) { # in child, unset warnings, disable debugging and general clean up from us $^W = 0; -# do "$main::root/perl/Disable_debug.pl"; eval "{ package DB; sub DB {} }"; + $SIG{HUP} = 'IGNORE'; alarm(0); + DXChannel::closeall(); $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT'; exec "$line"; dbg('cron', "exec '$line' failed $!"); @@ -217,6 +222,9 @@ sub spawn } else { dbg('cron', "can't fork for $line $!"); } + + # coordinate + sleep(1); } 1; __END__