3 # Lock all non local nodes that have a privileges <= 1
5 # WARNING - this must be run when the cluster.pl is down!
7 # Copyright (c) 1998 Dirk Koopman G1TLH
12 # make sure that modules are searched in the order local then perl
15 # root of directory tree for this system
17 $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
18 unshift @INC, "$root/perl"; # this IS the right way round!
19 unshift @INC, "$root/local";
26 my $lockfn = localdata("cluster.lck"); # lock file name
28 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
31 die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
35 my @nodes = map { uc } @ARGV;
42 my ($action, $key, $data) = (0,0,0);
43 for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) {
44 if ($data =~ m{sort => '[ACRSX]'}) {
45 my $user = DXUser::get($key);
48 if (grep $key eq $_, (@nodes, $mycall)) {
52 my $priv = $user->priv;
57 $user->priv(1) unless $priv;
65 print "locked out $count nodes out of $nodes\n";
66 print scalar @ignore, " nodes ignored (", join(',', @ignore), ")\n";
67 print "If there are any nodes missing on the above list then you MUST do\n";
68 print "a set/node (set/spider, set/clx etc) on each of them to allow them\n";
69 print "to connect to you or you to them\n";