X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fcluster.pl;h=db05800f9c305216aa06bcec7e707930ffb71c96;hb=e637d28f26ba92ea69edb06c6c564e1acfffd75e;hp=4c0f374c3eca9bfc54304b4826bef353bb851bab;hpb=c83b1ca22765fc07e5adcdc8dac24cbd066c9b95;p=spider.git diff --git a/perl/cluster.pl b/perl/cluster.pl index 4c0f374c..db05800f 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -90,6 +90,7 @@ BEGIN { } + use DXVars; use SysVar; @@ -263,8 +264,8 @@ sub new_channel $lock = $user->lockout; } elsif ($basecall ne $call) { # if there isn't a SSID on the $call, then try the base - $user = DXUser::get_current($basecall); - $lock = $user->lockout if $user; + my $luser = DXUser::get_current($basecall); + $lock = $luser->lockout if $luser; } # now deal with the lock @@ -427,7 +428,7 @@ sub cease $l->close_server; } - LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) ended"); + LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) on $^O ended"); dbg("bye bye everyone - bye bye"); dbgclose(); Logclose(); @@ -478,6 +479,8 @@ sub setup_start # ############################################################# + chdir $root; + $starttime = $systime = time; $systime_days = int ($systime / 86400); $systime_daystart = $systime_days * 86400; @@ -513,26 +516,25 @@ sub setup_start import Encode; $can_encode = 1; } + $gitbranch = 'none'; $gitversion = 'none'; - eval { require Git; }; - unless ($@) { - import Git; - # determine the real version number - my $repo = Git->repository(Directory => "$root/.git"); - if ($repo) { - my $desc = $repo->command_oneline(['describe', '--long'], STDERR => 0); - if ($desc) { - my ($v, $s, $b, $g) = $desc =~ /^([\d.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/; - $s ||= ''; - dbg("Git: $desc") if isdbg('git'); - dbg("Git: V=$v S=$s B=$b g=$g") if isdbg('git'); - $version = $v; - $build = $b || 0; - $gitversion = "$g\[r]"; - } - my @branch = $repo->command([qw{branch}], STDERR=>0); + # determine the real Git build number and branch + my $desc; + eval {$desc = `git describe --long`}; + if (!$@ && $desc) { + my ($v, $s, $b, $g) = $desc =~ /^([\d\.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/; + $version = $v; + my $subversion = $s || 0; # not used elsewhere + $build = $b || 0; + $gitversion = "$g\[r]"; + } + if (!$@) { + my @branch; + + eval {@branch = `git branch`}; + unless ($@) { for (@branch) { my ($star, $b) = split /\s+/; if ($star eq '*') { @@ -542,16 +544,23 @@ sub setup_start } } } + $SIG{__DIE__} = $w; } + # setup location of motd & issue + localdata_mv($motd); + $motd = localdata($motd); + localdata_mv("issue"); + + # try to load XML::Simple DXXml::init(); # banner my ($year) = (gmtime)[5]; $year += 1900; - LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) started"); + LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) on $^O started"); dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH"); # load Prefixes @@ -664,19 +673,26 @@ sub setup_start dbg("Start Protocol Engines ..."); DXProt->init(); + # read startup script + my $script = new Script "startup"; + $script->run($main::me) if $script; + + # put in a DXCluster node for us here so we can add users and take them away + $routeroot = Route::Node->new($mycall, $version*100+5300, Route::here($main::me->here)|Route::conf($main::me->conf)); + $routeroot->do_pc9x(1); + $routeroot->via_pc92(1); + # make sure that there is a routing OUTPUT node default file #unless (Filter::read_in('route', 'node_default', 0)) { # my $dxcc = $main::me->dxcc; # $Route::filterdef->cmd($main::me, 'route', 'accept', "node_default call $mycall" ); #} - my $script = new Script "startup"; - $script->run($main::me) if $script; - # initial the Spot stuff dbg("Starting DX Spot system"); - Spot->init(); # - + Spot->init(); + + # read in any existing message headers and clean out old crap dbg("reading existing message headers ..."); DXMsg->init(); DXMsg::clean_old();