X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2Fcluster.pl;h=b33a8b6e0cf81a14832e424182b70a8d2b2453f0;hb=f7ad460466e7e783eda20d467146ef29fde1f4fa;hp=d108a560c3187871f370b6615afad51bab761ce4;hpb=cde4b624b9eccd5b360d9cc7047a7f73527885aa;p=spider.git diff --git a/perl/cluster.pl b/perl/cluster.pl index d108a560..b33a8b6e 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -23,6 +23,14 @@ BEGIN { unshift @INC, "$root/perl"; # this IS the right way round! unshift @INC, "$root/local"; + # do some validation of the input + die "The directory $root doesn't exist, please RTFM" unless -d $root; + die "$root/local doesn't exist, please RTFM" unless -d "$root/local"; + die "$root/local/DXVars.pm doesn't exist, please RTFM" unless -e "$root/local/DXVars.pm"; + + mkdir "$root/local_cmd", 0777 unless -d "$root/local_cmd"; + + # try to create and lock a lockfile (this isn't atomic but # should do for now $lockfn = "$root/perl/cluster.lck"; # lock file name @@ -105,7 +113,7 @@ use vars qw(@inqueue $systime $version $starttime $lockfn @outstanding_connects @inqueue = (); # the main input queue, an array of hashes $systime = 0; # the time now (in seconds) -$version = "1.49"; # the version no of the software +$version = "1.50"; # the version no of the software $starttime = 0; # the starting time of the cluster #@outstanding_connects = (); # list of outstanding connects @listeners = (); # list of listeners @@ -382,6 +390,14 @@ Bands::load(); dbg("loading user file system ..."); DXUser->init($userfn, 1); +# look for the sysop and the alias user and complain if they aren't there +{ + my $ref = DXUser->get($mycall); + die "$mycall missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9; + $ref = DXUser->get($myalias); + die "$myalias missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9; +} + # start listening for incoming messages/connects dbg("starting listeners ..."); my $conn = IntMsg->new_server($clusteraddr, $clusterport, \&login);