X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fconnect.pl;h=df9a42389c73dc38400c0b8f4b12dd3904855da0;hb=5acd1be649672f6e5bd2b4a6772b51cd935ebda9;hp=e1263887d96e99fd0fe00b6a82402054bf4cdb5f;hpb=a9b7071fedfdb2150f3ef3d74e0d626b4f2dc0ea;p=spider.git diff --git a/cmd/connect.pl b/cmd/connect.pl index e1263887..df9a4238 100644 --- a/cmd/connect.pl +++ b/cmd/connect.pl @@ -7,7 +7,7 @@ my $lccall = lc $call; return (0) if $self->priv < 8; return (1, $self->msg('e6')) unless $call gt ' '; -return (1, $self->msg('already', $call)) if DXChannel::get($call); +return (1, $self->msg('already', $call)) if DXChannel->get($call); return (1, $self->msg('conscript', $lccall)) unless -e "$main::root/connect/$lccall"; my $prog = "$main::root/local/client.pl"; @@ -16,9 +16,16 @@ $prog = "$main::root/perl/client.pl" if ! -e $prog; my $pid = fork(); if (defined $pid) { if (!$pid) { - # in child + # in child, unset warnings, disable debugging and general clean up from us + $^W = 0; + $SIG{HUP} = 'IGNORE'; + eval "{ package DB; sub DB {} }"; + alarm(0); + DXChannel::closeall(); + $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT'; exec $prog, $call, 'connect'; } else { + sleep(1); # do a coordination return(1, $self->msg('constart', $call)); } }