X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fclient.pl;h=c6f5bd2806c12d0ad0359af074fbf132cc7821ed;hb=a2c19a364c62f032cacc0766d987db9daa1f9983;hp=6358d0225f6e4ad7fa1ae02f781ff4fff676cae8;hpb=678715c76fa49f08acb30df0760b34407f49675c;p=spider.git diff --git a/perl/client.pl b/perl/client.pl index 6358d022..c6f5bd28 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # # A thing that implements dxcluster 'protocol' # @@ -41,7 +41,6 @@ BEGIN { use Msg; use DXVars; use DXDebug; -use DXUser; use IO::File; use IO::Socket; use IPC::Open2; @@ -60,6 +59,7 @@ sub cease dbg('connect', "killing $pid"); kill(9, $pid); } + dbgclose(); sleep(1); exit(0); } @@ -128,7 +128,8 @@ sub rec_socket $mode = $line; # set echo mode from cluster my $term = POSIX::Termios->new; $term->getattr(fileno($sock)); - $term->setflag( &POSIX::ISIG ); + $term->setiflag( 0 ); + $term->setoflag( 0 ); $term->setattr(fileno($sock), &POSIX::TCSANOW ); } } elsif ($sort eq 'I') { @@ -345,6 +346,7 @@ $SIG{'INT'} = \&sig_term; $SIG{'TERM'} = \&sig_term; $SIG{'HUP'} = 'IGNORE'; $SIG{'CHLD'} = \&sig_chld; +$SIG{'ALRM'} = \&timeout; dbgadd('connect'); @@ -364,6 +366,8 @@ if ($loginreq) { } + use DXUser; + DXUser->init($userfn); # allow a login from an existing user. I could create a user but @@ -415,7 +419,7 @@ if ($connsort eq "connect") { open(IN, "$cpath/$mcall") or cease(2); @in = ; close IN; - + alarm($timeout); for (@in) {