added logging
[spider.git] / perl / cluster.pl
index 07c405038e68874dc70e94938ded9045a6903f5d..848131f70ba8d28906a98f43d685391a03cc893c 100755 (executable)
@@ -18,10 +18,15 @@ BEGIN {
        
        unshift @INC, "$root/perl";     # this IS the right way round!
        unshift @INC, "$root/local";
+
+#      require Exporter;
+#      $Exporter::Verbose = 1;
 }
 
 use Msg;
 use DXVars;
+use DXDebug;
+use DXLog;
 use DXUtil;
 use DXChannel;
 use DXUser;
@@ -30,7 +35,6 @@ use DXCommandmode;
 use DXProt;
 use DXMsg;
 use DXCluster;
-use DXDebug;
 use DXCron;
 use DXConnect;
 use Prefix;
@@ -43,7 +47,7 @@ package main;
 
 @inqueue = ();                                 # the main input queue, an array of hashes
 $systime = 0;                                  # the time now (in seconds)
-$version = 1.3;                                        # the version no of the software
+$version = 1.4;                                        # the version no of the software
 
 # handle disconnections
 sub disconnect
@@ -125,6 +129,7 @@ sub cease
        foreach $dxchan (DXChannel->get_all()) {
                disconnect($dxchan);
        }
+       Log('cluster', "DXSpider V$version stopped");
        exit(0);
 }
 
@@ -167,12 +172,13 @@ sub process_inqueue
 #############################################################
 
 # open the debug file, set various FHs to be unbuffered
-dbginit($debugfn);
 foreach (@debug) {
        dbgadd($_);
 }
 STDOUT->autoflush(1);
 
+Log('cluster', "DXSpider V$version started");
+
 # banner
 print "DXSpider DX Cluster Version $version\nCopyright (c) 1998 Dirk Koopman G1TLH\n";
 
@@ -236,9 +242,9 @@ for (;;) {
                $systime = $timenow;
                $cldate = &cldate();
                $ztime = &ztime();
+               DXCron::process();      # do cron jobs
                DXCommandmode::process(); # process ongoing command mode stuff
                DXProt::process();              # process ongoing ak1a pcxx stuff
-               DXCron::process();
                DXConnect::process();
        }
 }