Fix sh/dx on 14050 so it does what one expects
[spider.git] / perl / cluster.pl
index 4aa81c62e939b52467dbbe1a4bb24de4b5a69c02..092a01e058beac4a9959d0f6b10f9547ec0abe53 100755 (executable)
@@ -15,12 +15,18 @@ package main;
 require 5.10.1;
 use warnings;
 
-use vars qw($root $is_win $systime);
+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'};
@@ -42,7 +48,7 @@ BEGIN {
 
        # try to create and lock a lockfile (this isn't atomic but
        # should do for now
-       my $lockfn = "$root/local_data/cluster.lck";       # lock file name
+       $lockfn = "$root/local_data/cluster.lck";       # lock file name
        if (-w $lockfn) {
                open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
                my $pid = <CLLOCK>;
@@ -69,7 +75,7 @@ use DXVars;
 use SysVar;
 
 use strict;
-                       
+
 use Mojo::IOLoop;
 
 use Msg;