use DXUtil;
use DXM;
use DXDebug;
-use FileHandle;
+use IO::File;
use Carp;
use strict;
sub cread
{
my $fn = shift;
- my $fh = new FileHandle;
+ my $fh = new IO::File;
my $line = 0;
dbg('cron', "cron: reading $fn\n");
my $call = uc shift;
my $lccall = lc $call;
+ if (grep {$_->{call} eq $call} @main::outstanding_connects) {
+ dbg('cron', "Connect not started, outstanding connect to $call");
+ return;
+ }
+
my $prog = "$main::root/local/client.pl";
$prog = "$main::root/perl/client.pl" if ! -e $prog;
alarm(0);
DXChannel::closeall();
$SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
- exec $prog, $call, 'connect';
- dbg('cron', "exec '$prog' failed $!");
+ exec $prog, $call, 'connect' or dbg('cron', "exec '$prog' failed $!");
}
dbg('cron', "connect to $call started");
} else {
alarm(0);
DXChannel::closeall();
$SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
- exec "$line";
- dbg('cron', "exec '$line' failed $!");
+ exec "$line" or dbg('cron', "exec '$line' failed $!");
}
dbg('cron', "spawn of $line started");
} else {