[Dxspider-support] crontab 'spawn' command will kick all connected users and nodes

JOSEPH REED joe at n9jr.com
Sat Apr 10 01:01:20 CEST 2021


I don’t see it.  I was waiting for today when my crontab triggered the update and no users or nodes were disconnected and it updated just fine like should.  My Perl is weak to non existent but the if(!$pid) block looks like an exception handler to me.

It works perfect on 1.57 Build 344.

Those with more Perl knowledge can correct me, but it looks like it is doing as expected.

Joe N9JR



> On Apr 8, 2021, at 8:42 AM, David Spoelstra via Dxspider-support <dxspider-support at tobit.co.uk> wrote:
> 
> Saki-
> You are correct! Good catch! I dug into the "spawn" code in DXCron.pm (below) and I see that "spawn" does a "DXChannel::closeall();". I don't know why, but Dirk must have decided it was needed.
> -David, N9KT
> 
> # spawn any old job off
> sub spawn
> {
>         my $line = shift;
>         
>         my $pid = fork();
>         if (defined $pid) {
>                 if (!$pid) {
>                         # in child, unset warnings, disable debugging and general clean up from us
>                         $^W = 0;
>                         eval "{ package DB; sub DB {} }";
>                         DXChannel::closeall();
>                         for (@main::listeners) {
>                                 $_->close_server;
>                         }
>                         unless ($main::is_win) {
>                                 $SIG{HUP} = 'IGNORE';
>                                 $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
>                                 alarm(0);
>                         }
>                         exec "$line" or dbg("exec '$line' failed $!") if isdbg('cron');
>                 }
>                 dbg("spawn of $line started") if isdbg('cron');
>         } else {
>                 dbg("can't fork for $line $!") if isdbg('cron');
>         }
> 
>         # coordinate
>         sleep(1);
> }
> 
> On Thu, Apr 8, 2021 at 3:32 AM dd5xx--- via Dxspider-support <dxspider-support at tobit.co.uk <mailto:dxspider-support at tobit.co.uk>> wrote:
> Hi David et all,
>  
> thanks for sharing your local crontab script. I have implemented my updates via my own bash script, independent of DXspider. I actually do the exact same thing, however the DXspider process doesn't get anything out of it except at the end when I run the load/prefix.
>  
> I like to think outside the box and have also tried it via Spiders' local crontab as you suggested. However, while following along using 'watchdbg' and 'set/debug cron', I noticed that *EVERY* 'spawn' command in the crontab causes all connected users and nodes to be disconnected! In the watchdbg output window it looks like this:
>  
> 06:59:01 DXCommand
> 06:59:01 DL1ABC disconnected
> 06:59:01 DXCommand
> 06:59:01 DL2ABC-5 disconnected
> 06:59:01 DXCommand
> 06:59:01 DL3ABC disconnected
> 06:59:01 DXCommand
> 06:59:35 DXCommand
> 06:59:35 DL1ABC connected from 111.222.33.44
>  
> The documentation for DXspider crontab <http://www.dxcluster.org/main/cron.html <http://www.dxcluster.org/main/cron.html>> unfortunately does not give a more detailed information.
> 
> [...]
> spawn(<command>) - start a <command> as a new process. This is used to do various batch jobs that you may wish to happen at certain times of the day or week that operate on your machine but don't require access to the real-time internals of the cluster daemon. You can execute just about any command you like, but be warned stdin and stdout are still connected to the same terminal (if any) as the cluster daemon. Any unix command and arguments can be used, see exec in the perl documentation.
> [...]
>  
> For my needs the spawn event and the resulted disconnects for users/nodes is a no-go as I don't want my connected users+nodes to be disconnected. So I will continue to use my own external bash script for the cty.dat and wpxloc.raw updates as usual.
>  
> ==> Nevertheless, I'm curious if this is also the case for you, that the currently connected users+nodes are disconnected at the spawn command ? Looking forward to hear some comments.
>  
> I want to add that I do not use Mojo but still (consciously) running version 1.55
>  
> 73
> Saki, DD5XX
>  
>  
> Gesendet: Donnerstag, 04. März 2021 um 04:14 Uhr
> Von: "David Spoelstra via Dxspider-support" <dxspider-support at tobit.co.uk <mailto:dxspider-support at tobit.co.uk>>
> An: "The DXSpider Support list" <dxspider-support at tobit.co.uk <mailto:dxspider-support at tobit.co.uk>>
> Cc: "David Spoelstra" <davids at mediamachine.com <mailto:davids at mediamachine.com>>
> Betreff: Re: [Dxspider-support] CTY-3105 Country Files - 03 March 2021
> OK, found the problem. I was using http vs https when I fetched the file - that made all the difference.
>  
> If anyone wants to use my DXSpider cron, you are most welcome. Just to make sure everyone understands, you can put a crontab in /spider/local_cmd/ and it will run. I put all my DXSpider stuff in there to keep everything dealing with DXSpider in one place.
>  
> My DXSpider crontab in /spider/local_cmd/:
>  
> # /spider/local_cmd/crontab
> # MAKE SURE /spider/cmd_import EXISTS!
> # min, hour, day-of-month, month, day-of-week (0=Sun)
> # TIME IS UTC!
> 
> # Connect to other nodes
> * * * * * start_connect('w9pa') unless connected('w9pa')
> * * * * * start_connect('wb3ffv') unless connected('wb3ffv')
> * * * * * start_connect('ky4xx') unless connected('ky4xx')
> 
> # Monday 1am local - Get latest FCC data (W1NR updates Sundays)
> 0 5 * * 1 spawn("cd /tmp && wget -Nq ftp://ftp.w1nr.net/usdbraw.gz <ftp://ftp.w1nr.net/usdbraw.gz> && /spider/perl/create_usdb.pl <http://create_usdb.pl/> usdbraw.gz")
> 2 5 * * 1 run_cmd("load/usdb")
> 4 5 * * 1 spawn("rm /tmp/usdbraw.gz")
> 
> # Friday 1am local - Get latest Keps to be ready for any contest
> 0 5 * * 5 spawn("cd /tmp && wget -Nq https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt <https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt> && /spider/perl/convkeps.pl <http://convkeps.pl/> -p nasabare.txt")
> 2 5 * * 5 run_cmd("load/keps")
> 4 5 * * 5 spawn("rm /tmp/nasabare.txt")
> 
> # Friday 1am local - Get latest cty.dat to be ready for any contest
> 6  5 * * 5 spawn("cd /spider/data && wget -Nq https://www.country-files.com/cty/cty.dat <https://www.country-files.com/cty/cty.dat>")
> 8  5 * * 5 spawn("cd /spider/data && wget -Nq https://www.country-files.com/cty/wpxloc.raw <https://www.country-files.com/cty/wpxloc.raw>")
> 10 5 * * 5 spawn("cd /spider/data && /spider/perl/create_prefix.pl <http://create_prefix.pl/>")
> 12 5 * * 5 run_cmd("load/prefixes")
> 
> # Friday 1am local - Update DXSpider to be ready for any contest
> 14 5 * * 5 spawn("cd /spider && git reset --hard && git pull")
>  
> -David, N9KT
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at tobit.co.uk <mailto:Dxspider-support at tobit.co.uk>
> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support <https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support>
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at tobit.co.uk
> https://mailman.tobit.co.uk/mailman/listinfo/dxspider-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.tobit.co.uk/pipermail/dxspider-support/attachments/20210409/85bc106a/attachment-0001.htm>


More information about the Dxspider-support mailing list