From: Dirk Koopman Date: Wed, 15 Feb 2017 22:50:34 +0000 (+0000) Subject: Merge branch 'mojo' of ssh://server/scm/spider into mojo X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=c80c2aab681f6f691f7b9a5fa76cde2e938562c0;hp=0831a1b786d5f3e83aef6ee603b470f86310e8cf;p=spider.git Merge branch 'mojo' of ssh://server/scm/spider into mojo Conflicts: Changes perl/cluster.pl --- diff --git a/Changes b/Changes index 60e1d87c..ac17a93f 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ 15Feb17======================================================================= 1. Update UPGRADE.mojo a bit -2. Fix(?) problems picking up SysVar.pm variables. +2. Add local::lib so that it can be used for non-root installations. +09Jan17======================================================================= +1. Fix mojo branch clean install issues (failing to find $main::data et al) 02Jan17======================================================================= 1. Add CTY-2615 prefixes 2. Add rbn.pl - an experimental rbn deduplicating spot filter. diff --git a/perl/SysVar.pm b/perl/SysVar.pm index 92a81e4b..a4521878 100644 --- a/perl/SysVar.pm +++ b/perl/SysVar.pm @@ -6,7 +6,8 @@ # package main; -use warnings; + +use vars qw($data $local_data $system $cmd $localcmd $userfn $motd); ## ## DXVars.pm overrides @@ -26,12 +27,6 @@ $cmd = "$root/cmd"; # local command files live in (and overide $cmd) $localcmd = "$root/local_cmd"; -# data files live in -$data = "$root/data"; - -# for local data -$local_data = "$root/local_data"; - # where the user data lives $userfn = "$local_data/users"; diff --git a/perl/cluster.pl b/perl/cluster.pl index ca73a824..054a22ca 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -15,6 +15,8 @@ package main; require 5.10.1; use warnings; +use vars qw($root $is_win $systime); + # make sure that modules are searched in the order local then perl BEGIN { umask 002; @@ -38,12 +40,15 @@ BEGIN { die "$root/local/DXVars.pm doesn't exist, please RTFM" unless -e "$root/local/DXVars.pm"; # create some directories - mkdir "$root/local_cmd", 02777 unless -d "$root/local_cmd"; - mkdir "$root/local_data", 02777 unless -d "$root/local_data"; + mkdir "$root/local_cmd", 02774 unless -d "$root/local_cmd"; + + # locally stored data lives here + my $local_data = "$root/local_data"; + mkdir $local_data, 02774 unless -d $local_data; # try to create and lock a lockfile (this isn't atomic but # should do for now - $lockfn = "$root/local_data/cluster.lck"; # lock file name + my $lockfn = "$root/local_data/cluster.lck"; # lock file name if (-w $lockfn) { open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!"; my $pid = ; @@ -63,11 +68,14 @@ BEGIN { $is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows? $systime = time; + } use DXVars; use SysVar; +use strict; + use Mojo::IOLoop; use Msg; @@ -132,12 +140,9 @@ use Web; use Local; -package main; - -use strict; -use vars qw(@inqueue $systime $starttime $lockfn @outstanding_connects - $zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr - $clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting +use vars qw(@inqueue $starttime $lockfn @outstanding_connects + $zombies @listeners $lang $myalias @debug $userfn $clusteraddr + $clusterport $mycall $decease $routeroot $me $reqreg $bumpexisting $allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart $can_encode $maxconnect_user $maxconnect_node $idle_interval $log_flush_interval $broadcast_debug