+26Jul00=======================================================================
+1. added wantgrid (to control display of grid square info on DX Broadcasts)
+2. added lastoper for controlling periodic demands for user info from other
+nodes.
+3. added spiderFAQ stuff from Ian G0VGS and latest update of the admin manual
+4. changed updating and deleting from user file in an attempt to keep down
+duplicates and possibly corruptions.
+5. added a DXUser::export routine to allow the cluster to automatically
+export the user data in ascii from cron.
+6. added a line in the ISSUED crontab to do the export once a week
+7. delete annok and dxok if set to 1 in user records.
+8. added export_users command to allow arbitary exporting of user files
+9. added set and unset/dxgrid command to allow control over the grid squares
+on DX announcements
25Jul00=======================================================================
1. ignore \n in ax25 mode for C client.
2. remove extra space at the end of a DX spot announce when no grid square
EXPORT 2345 /tmp/a
+=== 9^EXPORT_USERS [<filename>]^Export the users database to ascii
+Export the users database to a file in ascii format. If no filename
+is given then it will export the file to /spider/data/user_asc.
+
+If the file already exists it will be renamed to <filename>.o. In fact
+up to 5 generations of the file can be kept each one with an extra 'o' on the
+suffix.
+
+BE WARNED: this will write to any file you have write access to. No check is
+made on the filename (if any) that you specify.
=== 1^FORWARD/OPERNAME <call>^Send out information on this <call> to all clusters
This command sends out any information held in the user file which can
=== 0^SET/DX^Allow DX messages to come out on your terminal
=== 0^UNSET/DX^Stop DX messages coming out on your terminal
+=== 0^SET/DXGRID^Allow Grid Squares on the end of DX announcements
+=== 0^UNSET/DXGRID^Stop Grid Squares on the end of DX announcements
+A standard feature which is enabled in version 1.43 and above is
+that if the spotter's grid square is known it is output on the end
+of a DX announcement (there is just enough room). Some user programs
+cannot cope with this. You can use this command to reset (or set)
+this feature.
+
=== 0^SET/ECHO^Make the cluster echo your input
=== 0^UNSET/ECHO^Stop the cluster echoing your input
If you are connected via a telnet session, different implimentations
# create and edit the one in /spider/local_cmd/crontab
# for doing connections and things
#
+1 0 * * 0 DXUser::export("$main::data/user_asc")
# Store it here (but only if it isn't baddx)
if (grep $_ eq $spotted, @DXProt::baddx) {
- my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter);
+ my $buf = Spot::formatb($self->user->wantgrid, $freq, $spotted, $main::systime, $line, $spotter);
push @out, $buf;
} else {
return (1, $self->msg('dup')) if Spot::dup($freq, $spotted, $main::systime, $line);
--- /dev/null
+#
+# the export the user file to ascii command
+#
+# $Id$
+#
+my $self = shift;
+return (1, $self->msg('e5')) unless $self->priv >= 9;
+my $line = shift || "$main::data/user_asc";
+return (1, DXUser::export($line));
--- /dev/null
+#
+# set the dxgrid flag
+#
+# Copyright (c) 2000 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+
+@args = $self->call if (!@args || $self->priv < 9);
+
+foreach $call (@args) {
+ $call = uc $call;
+ my $user = DXUser->get_current($call);
+ if ($user) {
+ $user->wantgrid(1);
+ $user->put;
+ push @out, $self->msg('grids', $call);
+ } else {
+ push @out, $self->msg('e3', "Set Grid", $call);
+ }
+}
+return (1, @out);
my @out;
$call = uc $call;
-my $user = DXUser->get($call);
+my $user = DXUser->get_current($call);
unless ($user) {
$user = DXUser->new($call);
push @out, $self->msg('spf1', $call);
# if we haven't got an explicit via and we can't see them, try their node
unless ($ref || $via) {
- my $user = DXUser->get($call);
+ my $user = DXUser->get_current($call);
$ref = DXCluster->get_exact($user->node) if $user;
if ($ref) {
$via = $user->node;
--- /dev/null
+#
+# unset the dxgrid flag
+#
+# Copyright (c) 2000 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+
+@args = $self->call if (!@args || $self->priv < 9);
+
+foreach $call (@args) {
+ $call = uc $call;
+ my $user = DXUser->get_current($call);
+ if ($user) {
+ $user->wantgrid(0);
+ $user->put;
+ push @out, $self->msg('gridu', $call);
+ } else {
+ push @out, $self->msg('e3', "Unset Grid", $call);
+ }
+}
+return (1, @out);
that mail to go. For example, you can see here that mail sent to "UK" will
only be sent to the UK links and not to PA4AB-14.
<P>
-<P>To force the cluster to reread the file use load/forward
+<P>At the moment, once the file is edited, the program will need to be restarted
+for the changes to take effect.
<P>
<H2><A NAME="ss6.6">6.6 Distribution lists</A>
</H2>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
+ <TITLE>The DXSpider FAQ : Installation </TITLE>
+ <LINK HREF="spiderFAQ-2.html" REL=next>
+
+ <LINK HREF="spiderFAQ.html#toc1" REL=contents>
+</HEAD>
+<BODY>
+<A HREF="spiderFAQ-2.html">Next</A>
+Previous
+<A HREF="spiderFAQ.html#toc1">Contents</A>
+<HR>
+<H2><A NAME="s1">1. Installation </A></H2>
+
+<H2><A NAME="ss1.1">1.1 Where do I get DXSpider?</A>
+</H2>
+
+<P>All things Spider can be found at
+<A HREF="http://www.dxcluster.org">www.dxcluster.org</A> and the actual program and patches can be found in the
+<A HREF="http://www.dxcluster.org/download/index.html">download</A> area.
+<P>
+<H2><A NAME="ss1.2">1.2 How do I use the patches?</A>
+</H2>
+
+<P>Patching is done in the standard linux way ...
+<P>
+<BLOCKQUOTE><CODE>
+<PRE>
+zcat /tmp/patch-1.40 | patch -p0
+</PRE>
+</CODE></BLOCKQUOTE>
+<P>
+<P>assuming the patch version you are using is 1.40 and resides in /tmp!
+<P>
+<P>Be aware that each patch assumes the previous patch has been applied. That
+is to say if you are patching from version 1.38 to 1.40 you would first need
+to apply patch-1.39 and then patch-1.40.
+<P>
+<H2><A NAME="ss1.3">1.3 If I use a tarball to overwrite my installation, what happens to my configuration?</A>
+</H2>
+
+<P>The tarballs are designed to not overwrite your existing configuration
+and can be used at any time to update your Spider software. All the key
+files have the suffix .issue (eg. DXVars.pm.issue) at default.
+<P>
+<H2><A NAME="ss1.4">1.4 I am running RedHat 5.2 and I am getting strange errors, what is wrong?</A>
+</H2>
+
+<P>The version of Perl that comes with 5.2 seems to be some kind of pre-release
+and is broken. You can get a new version of perl from
+<A HREF="http://www.dxcluster.org/download/index.html">www.dxcluster.org</A>
+or
+<A HREF="ftp://updates.redhat.com">ftp://updates.redhat.com</A>.
+Don't forget to patch it with the CPAN modules.
+<P>
+<HR>
+<A HREF="spiderFAQ-2.html">Next</A>
+Previous
+<A HREF="spiderFAQ.html#toc1">Contents</A>
+</BODY>
+</HTML>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
+ <TITLE>The DXSpider FAQ : Administration</TITLE>
+ <LINK HREF="spiderFAQ-1.html" REL=previous>
+ <LINK HREF="spiderFAQ.html#toc2" REL=contents>
+</HEAD>
+<BODY>
+Next
+<A HREF="spiderFAQ-1.html">Previous</A>
+<A HREF="spiderFAQ.html#toc2">Contents</A>
+<HR>
+<H2><A NAME="s2">2. Administration</A></H2>
+
+<H2><A NAME="ss2.1">2.1 How can I get Spider to restart automatically if it crashes?</A>
+</H2>
+
+<P>Put this line into /etc/inittab ..
+<P>
+<BLOCKQUOTE><CODE>
+<PRE>
+DX:3:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop > /dev/tty7
+</PRE>
+</CODE></BLOCKQUOTE>
+<P>Run <EM>telinit q</EM> as root. Spider will restart so be aware. However, any
+time you reboot, cluster.pl will start in tty7 and if it crashes, it should restart ok.
+<P>
+<H2><A NAME="ss2.2">2.2 How can I monitor traffic to and from a node or user?</A>
+</H2>
+
+<P>There are 2 ways to achieve this. You can use the <EM>tail</EM> command like this ..
+<P>
+<BLOCKQUOTE><CODE>
+<PRE>
+tail -f /spider/data/debug/167.dat |grep G0VGS
+</PRE>
+</CODE></BLOCKQUOTE>
+<P>or in later versions of Spider, there is a command called <EM>watchdbg</EM> in which
+case you simply type ..
+<P>
+<BLOCKQUOTE><CODE>
+<PRE>
+watchdbg G0VGS
+</PRE>
+</CODE></BLOCKQUOTE>
+<P>
+<H2><A NAME="ss2.3">2.3 My neighbouring node cannot use the RCMD command to me, he just keeps getting the "tut tut" message.</A>
+</H2>
+
+<P>Assuming that the permissions are set correctly (perm level 5 required), it could be
+that the home_node is set incorrectly. You can reset the home_node using the <EM>spoof</EM>
+command like this ..
+<P>
+<BLOCKQUOTE><CODE>
+<PRE>
+spoof gb7adx set/home gb7adx
+</PRE>
+</CODE></BLOCKQUOTE>
+<P>Assuming that the node_call you are changing is gb7adx.
+<P>
+<H2><A NAME="ss2.4">2.4 I do not seem to be sending any bulletin mail to my link partners, what is wrong?</A>
+</H2>
+
+<P>There is a file in /spider/msg called forward.pl.issue. Rename this to
+forward.pl and edit it to meet your requirements. You will need to restart
+Spider for the changes to take effect.
+<P>
+<HR>
+Next
+<A HREF="spiderFAQ-1.html">Previous</A>
+<A HREF="spiderFAQ.html#toc2">Contents</A>
+</BODY>
+</HTML>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+ <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
+ <TITLE>The DXSpider FAQ </TITLE>
+ <LINK HREF="spiderFAQ-1.html" REL=next>
+
+
+</HEAD>
+<BODY>
+<A HREF="spiderFAQ-1.html">Next</A>
+Previous
+Contents
+<HR>
+<H1>The DXSpider FAQ </H1>
+
+<H2>Ian Maude, G0VGS, (ianmaude@btinternet.com)</H2>Version 0.2 July 2000
+<P><HR>
+<EM>A reference for SysOps of the DXSpider DXCluster program.</EM>
+<HR>
+<P>Please mail any FAQs to the maintainer at the address above.
+<P>
+<P>
+<P>
+<H2><A NAME="toc1">1.</A> <A HREF="spiderFAQ-1.html">Installation </A></H2>
+
+<UL>
+<LI><A HREF="spiderFAQ-1.html#ss1.1">1.1 Where do I get DXSpider?</A>
+<LI><A HREF="spiderFAQ-1.html#ss1.2">1.2 How do I use the patches?</A>
+<LI><A HREF="spiderFAQ-1.html#ss1.3">1.3 If I use a tarball to overwrite my installation, what happens to my configuration?</A>
+<LI><A HREF="spiderFAQ-1.html#ss1.4">1.4 I am running RedHat 5.2 and I am getting strange errors, what is wrong?</A>
+</UL>
+<P>
+<H2><A NAME="toc2">2.</A> <A HREF="spiderFAQ-2.html">Administration</A></H2>
+
+<UL>
+<LI><A HREF="spiderFAQ-2.html#ss2.1">2.1 How can I get Spider to restart automatically if it crashes?</A>
+<LI><A HREF="spiderFAQ-2.html#ss2.2">2.2 How can I monitor traffic to and from a node or user?</A>
+<LI><A HREF="spiderFAQ-2.html#ss2.3">2.3 My neighbouring node cannot use the RCMD command to me, he just keeps getting the "tut tut" message.</A>
+<LI><A HREF="spiderFAQ-2.html#ss2.4">2.4 I do not seem to be sending any bulletin mail to my link partners, what is wrong?</A>
+</UL>
+<HR>
+<A HREF="spiderFAQ-1.html">Next</A>
+Previous
+Contents
+</BODY>
+</HTML>
next if $ref->{'read'}; # if it is read, it is stuck here
$clref = DXCluster->get_exact($ref->{to});
unless ($clref) { # otherwise look for a homenode
- my $uref = DXUser->get($ref->{to});
+ my $uref = DXUser->get_current($ref->{to});
my $hnode = $uref->homenode if $uref;
$clref = DXCluster->get_exact($hnode) if $hnode;
}
$dxchan->send($routeit) unless $dxchan->{isolate} || $self->{isolate};
}
} elsif ($dxchan->is_user && $dxchan->{dx}) {
- my $buf = Spot::formatb($_[0], $_[1], $_[2], $_[3], $_[4]);
+ my $buf = Spot::formatb($dxchan->{user}->wantgrid, $_[0], $_[1], $_[2], $_[3], $_[4]);
$buf .= "\a\a" if $dxchan->{beep};
if ($dxchan->{state} eq 'prompt' || $dxchan->{state} eq 'convers') {
$dxchan->send($buf);
use DB_File;
use Data::Dumper;
use Fcntl;
+use IO::File;
use DXDebug;
use strict;
pingint => '9,Node Ping interval',
nopings => '9,Ping Obs Count',
wantlogininfo => '9,Login info req,yesno',
+ wantgrid => '0,DX Grid Info,yesno',
+ lastoper => '9,Last for/oper,cldatetime',
);
no strict;
my $self = bless {}, $pkg;
$self->{call} = $call;
$self->{'sort'} = 'U';
- $self->{dxok} = '1';
- $self->{annok} = '1';
- $self->{lang} = $main::lang;
$self->put;
return $self;
}
my $dxchan = DXChannel->get($call);
return $dxchan->user if $dxchan;
- my $s = $u{$call};
- return $s ? decode($s) : undef;
+ return get($pkg, $call);
}
#
my $self = shift;
confess "Trying to put nothing!" unless $self && ref $self;
my $call = $self->{call};
+ # delete all instances of this
+ for ($dbm->get_dup($call)) {
+ $dbm->del_dup($call, $_);
+ }
+ delete $self->{annok} if $self->{annok};
+ delete $self->{dxok} if $self->{dxok};
$u{$call} = $self->encode();
+ $dbm->sync;
}
#
{
my $self = shift;
my $call = $self->{call};
- delete $u{$call};
+ # delete all instances of this
+ for ($dbm->get_dup($call)) {
+ $dbm->del_dup($call, $_);
+ }
+ $dbm->sync;
}
#
return keys(%valid);
}
+
+#
+# export the database to an ascii file
+#
+
+sub export
+{
+ my $fn = shift;
+
+ # save old ones
+ rename "$fn.oooo", "$fn.ooooo" if -e "$fn.oooo";
+ rename "$fn.ooo", "$fn.oooo" if -e "$fn.ooo";
+ rename "$fn.oo", "$fn.ooo" if -e "$fn.oo";
+ rename "$fn.o", "$fn.oo" if -e "$fn.o";
+ rename "$fn", "$fn.o" if -e "$fn";
+
+ my $count = 0;
+ my $fh = new IO::File ">$fn" or return "cannot open $fn ($!)";
+ if ($fh) {
+ my $ref;
+ my $key;
+ my $action;
+ my $t = scalar localtime;
+ print $fh "#!/usr/bin/perl
+#
+# The exported userfile for a DXSpider System
+#
+# Input file: $filename
+# Time: $t
+#
+
+package DXUser;
+
+%u = (
+";
+
+ for ($action = R_FIRST; !$dbm->seq($key, $ref, $action); $action = R_NEXT) {
+ print $fh "'$key' => $ref,\n";
+ ++$count;
+ }
+ print $fh ");\n#\n# there were $count records\n#\n";
+ $fh->close;
+ }
+ return $count;
+}
+
#
# group handling
#
return _want('talk', @_);
}
+sub wantgrid
+{
+ return _want('grid', @_);
+}
+
sub wantlogininfo
{
my $self = shift;
export1 => 'usage: export <msgno> <filename>',
export2 => '$_[3] has error exporting msg $_[0] to $_[1] ($_[2])',
export3 => '$_[2 ] exported msg $_[0] to $_[1]',
+ grids => 'DX Grid flag set on $_[0]',
+ gridu => 'DX Grid flag unset on $_[0]',
helpe1 => 'Help system unavailable, tell sysop',
helpe2 => 'No help available on $_[0]',
heres => 'Here set on $_[0]',
# format a spot for user output in 'broadcast' mode
sub formatb
{
- my @dx = @_;
- my $t = ztime($dx[2]);
- my $ref = DXUser->get_current($dx[4]);
- my $loc = $ref->qra if $ref && $ref->qra;
+ my $wantgrid = shift;
+ my $t = ztime($_[2]);
+ my $ref = DXUser->get_current($_[4]);
+ my $loc = $ref->qra if $ref && $ref->qra && $wantgrid;
$loc = ' ' . substr($ref->qra, 0, 4) if $loc;
$loc = "" unless $loc;
- return sprintf "DX de %-7.7s%11.1f %-12.12s %-30s %s$loc", "$dx[4]:", $dx[0], $dx[1], $dx[3], $t ;
+ return sprintf "DX de %-7.7s%11.1f %-12.12s %-30s %s$loc", "$_[4]:", $_[0], $_[1], $_[3], $t ;
}
# format a spot for user output in list mode
sub formatl
{
- my @dx = @_;
- my $t = ztime($dx[2]);
- my $d = cldate($dx[2]);
- return sprintf "%8.1f %-11s %s %s %-28.28s%7s>", $dx[0], $dx[1], $d, $t, $dx[3], "<$dx[4]" ;
+ my $t = ztime($_[2]);
+ my $d = cldate($_[2]);
+ return sprintf "%8.1f %-11s %s %s %-28.28s%7s>", $_[0], $_[1], $d, $t, $_[3], "<$_[4]" ;
}
#
+++ /dev/null
-#!/usr/bin/perl
-#
-# Export the user file in a form that can be directly imported
-# back with a do statement
-#
-
-require 5.004;
-
-# search local then perl directories
-BEGIN {
- # root of directory tree for this system
- $root = "/spider";
- $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
-
- unshift @INC, "$root/perl"; # this IS the right way round!
- unshift @INC, "$root/local";
-}
-
-use DXVars;
-use DXUser;
-
-$userfn = $ARGV[0] if @ARGV;
-
-DXUser->init($userfn);
-
-@all = DXUser::get_all_calls();
-$t = scalar localtime;
-print "#!/usr/bin/perl
-#
-# The exported userfile for a DXSpider System
-#
-# Input file: $userfn
-# Time: $t
-#
-
-package DXUser;
-
-%u = (
-";
-
-for $a (@all) {
- my $ref = DXUser->get($a);
- if (ref $ref) {
- my $s = $ref->encode();
-
- print "'$a' => q{ $s },\n";
- } else {
- print "# $a has gorn missing\n";
- }
- $count++;
-}
-print ");\n
-#
-# there were $count records
-#\n";
-