set DXVar.pm defaults into console.pl
[spider.git] / perl / cluster.pl
index ca73a8249e81017c3705c34689f156294d7afff8..6495027be2a3a97f5276685434c908be7005ccde 100755 (executable)
@@ -15,6 +15,21 @@ package main;
 require 5.10.1;
 use warnings;
 
+use vars qw($root $is_win $systime $lockfn @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 
+                  );
+
+$lang = 'en';                                  # default language
+$clusteraddr = '127.0.0.1';            # cluster tcp host address - used for things like console.pl
+$clusterport = 27754;                  # cluster tcp port
+$yes = 'Yes';                                  # visual representation of yes
+$no = 'No';                                            # ditto for no
+$user_interval = 11*60;                        # the interval between unsolicited prompts if no traffic
+
 # make sure that modules are searched in the order local then perl
 BEGIN {
        umask 002;
@@ -38,8 +53,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
@@ -63,11 +81,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,16 +153,6 @@ 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
-                       $allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart
-                       $can_encode $maxconnect_user $maxconnect_node $idle_interval $log_flush_interval
-                       $broadcast_debug 
-                  );
 
 @inqueue = ();                                 # the main input queue, an array of hashes
 $systime = 0;                                  # the time now (in seconds)