From: djk Date: Sat, 17 Jun 2000 21:54:15 +0000 (+0000) Subject: 1. I believe I have fixed all the login/logout 'broken pipe' errors X-Git-Tag: R_1_42~12 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=502f900651a46b96008028945616a3b610d6cc7a;p=spider.git 1. I believe I have fixed all the login/logout 'broken pipe' errors 2. Added G0RDI's 'links' command. --- diff --git a/Changes b/Changes index a6e8d08a..76380d4e 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +17Jun00======================================================================= +1. I believe I have fixed all the login/logout 'broken pipe' errors +2. Added G0RDI's 'links' command. 14Jun00======================================================================= 1. fixed sh/node crash 2. fixed RTT in who.pl diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index 1e25f894..7dc27bc8 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -259,6 +259,10 @@ Delete a message (usually a 'bulletin') from the whole cluster system. This uses the subject field, so any messages that have exactly the same subject will be deleted. Beware! +=== 0^LINKS^Show which nodes is physically connected +This is a quick listing that shows which links are connected and +some information about them. See WHO for a list of all connections. + === 9^LOAD/ALIASES^Reload the command alias table Reload the /spider/cmd/Aliases file after you have editted it. You will need to do this if you change this file whilst the cluster is running in order for the diff --git a/cmd/links.pl b/cmd/links.pl new file mode 100644 index 00000000..456ea72f --- /dev/null +++ b/cmd/links.pl @@ -0,0 +1,32 @@ +# +# links : which are active +# a complete list of currently connected linked nodes +# +# Created by Iain Philipps G0RDI, based entirely on +# who.pl, which is Copyright (c) 1999 Dirk Koopman G1TLH +# +# 16-Jun-2000 +# $Id: links.pl + + +my $self = shift; +my $dxchan; +my @out; + +push @out, " Callsign Started Ave RTT"; + +foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_ak1a ) { + my $call = $dxchan->call(); + my $t = cldatetime($dxchan->startt); + my $name = $dxchan->user->name || " "; + my $ping = $dxchan->is_node && $dxchan != $DXProt::me ? sprintf("%8.2f", + $dxchan->pingave) : ""; + push @out, sprintf "%10s $t %-6.6s $ping", $call; + +} + +return (1, @out) + + + + diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 93d07c1d..3637b762 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -376,10 +376,8 @@ sub disconnect my $user = $self->{user}; my $conn = $self->{conn}; my $call = $self->{call}; - my $nopc39 = shift || 0; - $self->finish($nopc39); - $conn->send_now("Z$call|bye") if $conn; # this will cause 'client' to disconnect + $self->finish($conn); $user->close() if defined $user; $conn->disconnect() if $conn; $self->del(); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 1743af85..ca6a1c4e 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -306,13 +306,14 @@ sub process sub finish { my $self = shift; + my $conn = shift; my $call = $self->call; # I was the last node visited $self->user->node($main::mycall); # log out text - if (-e "$main::data/logout") { + if ($conn && -e "$main::data/logout") { open(I, "$main::data/logout") or confess; my @in = ; close(I); diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 74353d5b..fb1b4b95 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -878,11 +878,9 @@ sub finish { my $self = shift; my $call = $self->call; - my $nopc39 = shift; + my $conn = shift; my $ref = DXCluster->get_exact($call); - $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op"))) unless $nopc39; - # unbusy and stop and outgoing mail my $mref = DXMsg::get_busy($call); $mref->stop_msg($call) if $mref; @@ -1351,5 +1349,17 @@ sub addrcmd route(undef, $to, pc34($main::mycall, $to, $cmd)); } } + +sub disconnect +{ + my $self = shift; + my $nopc39 = shift; + + if ($self->{conn} && !$nopc39) { + $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op"))); + } + + $self->SUPER::disconnect; +} 1; __END__ diff --git a/perl/client.pl b/perl/client.pl index 1b6757b4..66c7b092 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -51,10 +51,10 @@ use IPC::Open2; sub cease { my $sendz = shift; - if ($conn && $sendz) { - $conn->send_now("Z$call|bye..."); - sleep(1); - } +# if ($conn && $sendz) { +# $conn->send_now("Z$call|bye..."); +# sleep(1); +# } $stdout->flush if $stdout; if ($pid) { dbg('connect', "killing $pid"); @@ -99,7 +99,7 @@ sub rec_socket { my ($con, $msg, $err) = @_; if (defined $err && $err) { - cease(1); + cease(0); } if (defined $msg) { my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/; @@ -155,6 +155,8 @@ sub rec_socket # any other sorts that might happen are silently ignored. # ****************************************************** # ****************************************************** + } else { + cease(0); } $lasttime = time; } diff --git a/perl/cluster.pl b/perl/cluster.pl index aa440067..5d6248ef 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -106,6 +106,11 @@ sub rec if (!defined $msg || (defined $err && $err)) { if ($dxchan) { + if (defined $err) { + $conn->disconnect; + undef $conn; + $dxchan->conn(undef); + } $dxchan->disconnect; } elsif ($conn) { $conn->disconnect; @@ -375,6 +380,11 @@ dbg('err', "orft we jolly well go ..."); #open(DB::OUT, "|tee /tmp/aa"); +$SIG{PIPE} = sub { + #$DB::single = 1; + dbg('err', "Broken PIPE signal received"); +}; + for (;;) { my $timenow; # $DB::trace = 1; diff --git a/perl/console.pl b/perl/console.pl index 35e5da7e..643286f6 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -101,9 +101,9 @@ sub do_resize sub cease { my $sendz = shift; - if ($conn && $sendz) { - $conn->send_now("Z$call|bye..."); - } +# if ($conn && $sendz) { +# $conn->send_now("Z$call|bye..."); +# } endwin(); dbgclose(); print @_ if @_; @@ -226,6 +226,8 @@ sub rec_socket # any other sorts that might happen are silently ignored. # ****************************************************** # ****************************************************** + } else { + cease(0); } $top->refresh(); $lasttime = time; diff --git a/src/client.c b/src/client.c index 1473682a..885b50ef 100644 --- a/src/client.c +++ b/src/client.c @@ -629,9 +629,11 @@ void term_timeout(int i) void terminate(int i) { +#if 0 if (node && send_Z && call) { send_msg(node, 'Z', "bye", 3); } +#endif signal(SIGALRM, term_timeout); alarm(10);