X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fcluster.pl;h=092a01e058beac4a9959d0f6b10f9547ec0abe53;hb=24e4238c084f15ae11f7aa75301f92df39ae5296;hp=4222132c2b982bee9fe2490d99cab9ca184ab224;hpb=0a1faadbc2cee1d5aa3690ed7fa32dd7443ed83d;p=spider.git diff --git a/perl/cluster.pl b/perl/cluster.pl index 4222132c..092a01e0 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -15,10 +15,18 @@ package main; require 5.10.1; use warnings; +use vars qw($root $is_win $systime $lockfn); + # make sure that modules are searched in the order local then perl BEGIN { umask 002; + # take into account any local::lib that might be present + eval { + require local::lib; + }; + import local::lib unless ($@); + # root of directory tree for this system $root = "/spider"; $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'}; @@ -32,8 +40,11 @@ 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 @@ -57,14 +68,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 +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