From 6c38bca91e6b75002e15cce29c45a894f675e22e Mon Sep 17 00:00:00 2001 From: minima Date: Wed, 26 Jul 2000 12:08:09 +0000 Subject: [PATCH] 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 10. removed export_user.pl from /spider/perl --- Changes | 14 ++++++++ cmd/Commands_en.hlp | 18 ++++++++++ cmd/crontab | 1 + cmd/dx.pl | 2 +- cmd/export_users.pl | 9 +++++ cmd/set/dxgrid.pl | 27 +++++++++++++++ cmd/spoof.pl | 2 +- cmd/talk.pl | 2 +- cmd/unset/dxgrid.pl | 27 +++++++++++++++ html/adminmanual-6.html | 3 +- html/spiderFAQ-1.html | 63 +++++++++++++++++++++++++++++++++++ html/spiderFAQ-2.html | 74 +++++++++++++++++++++++++++++++++++++++++ html/spiderFAQ.html | 47 ++++++++++++++++++++++++++ perl/DXMsg.pm | 2 +- perl/DXProt.pm | 2 +- perl/DXUser.pm | 73 ++++++++++++++++++++++++++++++++++++---- perl/Messages | 2 ++ perl/Spot.pm | 17 +++++----- perl/export_user.pl | 56 ------------------------------- 19 files changed, 364 insertions(+), 77 deletions(-) create mode 100644 cmd/export_users.pl create mode 100644 cmd/set/dxgrid.pl create mode 100644 cmd/unset/dxgrid.pl create mode 100644 html/spiderFAQ-1.html create mode 100644 html/spiderFAQ-2.html create mode 100644 html/spiderFAQ.html delete mode 100755 perl/export_user.pl diff --git a/Changes b/Changes index fc94a8d4..43d03af1 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,17 @@ +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 diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index 489308c3..5ef9126f 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -229,6 +229,16 @@ access. For example:- EXPORT 2345 /tmp/a +=== 9^EXPORT_USERS []^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 .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 ^Send out information on this to all clusters This command sends out any information held in the user file which can @@ -445,6 +455,14 @@ SP is an alias for SEND PRIVATE === 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 diff --git a/cmd/crontab b/cmd/crontab index 508faf5b..d385a844 100644 --- a/cmd/crontab +++ b/cmd/crontab @@ -5,3 +5,4 @@ # create and edit the one in /spider/local_cmd/crontab # for doing connections and things # +1 0 * * 0 DXUser::export("$main::data/user_asc") diff --git a/cmd/dx.pl b/cmd/dx.pl index 5e9eec1c..3a45f6ce 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -97,7 +97,7 @@ $line =~ s/\^/:/og; # 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); diff --git a/cmd/export_users.pl b/cmd/export_users.pl new file mode 100644 index 00000000..4c143ebb --- /dev/null +++ b/cmd/export_users.pl @@ -0,0 +1,9 @@ +# +# 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)); diff --git a/cmd/set/dxgrid.pl b/cmd/set/dxgrid.pl new file mode 100644 index 00000000..ba02bf7e --- /dev/null +++ b/cmd/set/dxgrid.pl @@ -0,0 +1,27 @@ +# +# 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); diff --git a/cmd/spoof.pl b/cmd/spoof.pl index 8c8fda85..7b9e20d4 100644 --- a/cmd/spoof.pl +++ b/cmd/spoof.pl @@ -25,7 +25,7 @@ if ($self->priv < 9) { 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); diff --git a/cmd/talk.pl b/cmd/talk.pl index 827ff672..fa7ade22 100644 --- a/cmd/talk.pl +++ b/cmd/talk.pl @@ -30,7 +30,7 @@ $ref = DXChannel->get($call) unless $ref; # is it local? # 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; diff --git a/cmd/unset/dxgrid.pl b/cmd/unset/dxgrid.pl new file mode 100644 index 00000000..dbef4190 --- /dev/null +++ b/cmd/unset/dxgrid.pl @@ -0,0 +1,27 @@ +# +# 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); diff --git a/html/adminmanual-6.html b/html/adminmanual-6.html index c5a557f7..2f6d3ed8 100644 --- a/html/adminmanual-6.html +++ b/html/adminmanual-6.html @@ -320,7 +320,8 @@ package DXMsg; 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.

-

To force the cluster to reread the file use load/forward +

At the moment, once the file is edited, the program will need to be restarted +for the changes to take effect.

6.6 Distribution lists

diff --git a/html/spiderFAQ-1.html b/html/spiderFAQ-1.html new file mode 100644 index 00000000..49518799 --- /dev/null +++ b/html/spiderFAQ-1.html @@ -0,0 +1,63 @@ + + + + + The DXSpider FAQ : Installation + + + + + +Next +Previous +Contents +
+

1. Installation

+ +

1.1 Where do I get DXSpider? +

+ +

All things Spider can be found at +www.dxcluster.org and the actual program and patches can be found in the +download area. +

+

1.2 How do I use the patches? +

+ +

Patching is done in the standard linux way ... +

+

+
+zcat /tmp/patch-1.40 | patch -p0
+
+
+

+

assuming the patch version you are using is 1.40 and resides in /tmp! +

+

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. +

+

1.3 If I use a tarball to overwrite my installation, what happens to my configuration? +

+ +

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. +

+

1.4 I am running RedHat 5.2 and I am getting strange errors, what is wrong? +

+ +

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 +www.dxcluster.org +or +ftp://updates.redhat.com. +Don't forget to patch it with the CPAN modules. +

+


+Next +Previous +Contents + + diff --git a/html/spiderFAQ-2.html b/html/spiderFAQ-2.html new file mode 100644 index 00000000..b66da49d --- /dev/null +++ b/html/spiderFAQ-2.html @@ -0,0 +1,74 @@ + + + + + The DXSpider FAQ : Administration + + + + +Next +Previous +Contents +
+

2. Administration

+ +

2.1 How can I get Spider to restart automatically if it crashes? +

+ +

Put this line into /etc/inittab .. +

+

+
+DX:3:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop > /dev/tty7
+
+
+

Run telinit q 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. +

+

2.2 How can I monitor traffic to and from a node or user? +

+ +

There are 2 ways to achieve this. You can use the tail command like this .. +

+

+
+tail -f /spider/data/debug/167.dat |grep G0VGS
+
+
+

or in later versions of Spider, there is a command called watchdbg in which +case you simply type .. +

+

+
+watchdbg G0VGS
+
+
+

+

2.3 My neighbouring node cannot use the RCMD command to me, he just keeps getting the "tut tut" message. +

+ +

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 spoof +command like this .. +

+

+
+spoof gb7adx set/home gb7adx
+
+
+

Assuming that the node_call you are changing is gb7adx. +

+

2.4 I do not seem to be sending any bulletin mail to my link partners, what is wrong? +

+ +

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. +

+


+Next +Previous +Contents + + diff --git a/html/spiderFAQ.html b/html/spiderFAQ.html new file mode 100644 index 00000000..cca3facc --- /dev/null +++ b/html/spiderFAQ.html @@ -0,0 +1,47 @@ + + + + + The DXSpider FAQ + + + + + +Next +Previous +Contents +
+

The DXSpider FAQ

+ +

Ian Maude, G0VGS, (ianmaude@btinternet.com)

Version 0.2 July 2000 +


+A reference for SysOps of the DXSpider DXCluster program. +
+

Please mail any FAQs to the maintainer at the address above. +

+

+

+

1. Installation

+ + +

+

2. Administration

+ + +
+Next +Previous +Contents + + diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 65577607..11a30a4e 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -616,7 +616,7 @@ sub queue_msg 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; } diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 02807937..532322d0 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -957,7 +957,7 @@ sub send_dx_spot $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); diff --git a/perl/DXUser.pm b/perl/DXUser.pm index e2efad56..2bd14034 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -15,6 +15,7 @@ use DXLog; use DB_File; use Data::Dumper; use Fcntl; +use IO::File; use DXDebug; use strict; @@ -63,6 +64,8 @@ $filename = undef; 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; @@ -126,9 +129,6 @@ sub new my $self = bless {}, $pkg; $self->{call} = $call; $self->{'sort'} = 'U'; - $self->{dxok} = '1'; - $self->{annok} = '1'; - $self->{lang} = $main::lang; $self->put; return $self; } @@ -172,8 +172,7 @@ sub get_current my $dxchan = DXChannel->get($call); return $dxchan->user if $dxchan; - my $s = $u{$call}; - return $s ? decode($s) : undef; + return get($pkg, $call); } # @@ -185,7 +184,14 @@ sub put 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; } # @@ -223,7 +229,11 @@ sub del { 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; } # @@ -246,6 +256,52 @@ sub fields 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 # @@ -375,6 +431,11 @@ sub wanttalk return _want('talk', @_); } +sub wantgrid +{ + return _want('grid', @_); +} + sub wantlogininfo { my $self = shift; diff --git a/perl/Messages b/perl/Messages index c0e71804..c2dae16c 100644 --- a/perl/Messages +++ b/perl/Messages @@ -67,6 +67,8 @@ package DXM; export1 => 'usage: export ', 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]', diff --git a/perl/Spot.pm b/perl/Spot.pm index 1938fbe7..3f4313ef 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -168,22 +168,21 @@ sub search # 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]" ; } # diff --git a/perl/export_user.pl b/perl/export_user.pl deleted file mode 100755 index 3157d21a..00000000 --- a/perl/export_user.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/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"; - -- 2.43.0