From: Dirk Koopman Date: Mon, 9 Jan 2017 14:57:02 +0000 (+0000) Subject: Fix issues finding $main::data etc on clean install X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e57c3e3573db848a474524fbe9723dea52e151a1;p=spider.git Fix issues finding $main::data etc on clean install --- diff --git a/Changes b/Changes index 5d16d91f..13fa2e16 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +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 4222132c..4aa81c62 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; @@ -32,12 +34,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 = ; @@ -57,14 +62,16 @@ BEGIN { $is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows? $systime = time; + } - -use Mojo::IOLoop; - use DXVars; use SysVar; +use strict; + +use Mojo::IOLoop; + use Msg; use IntMsg; use Internet; @@ -127,12 +134,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