changed lockfile name to .lck (from .lock) for M$
authorminima <minima>
Sun, 8 Apr 2001 23:21:28 +0000 (23:21 +0000)
committerminima <minima>
Sun, 8 Apr 2001 23:21:28 +0000 (23:21 +0000)
Changes
perl/DXUser.pm
perl/cluster.pl
perl/create_sysop.pl
perl/update_sysop.pl

diff --git a/Changes b/Changes
index fefdbcb43233ba8b7a860599f29d0c2e1b9b4162..2f05c43d99092c158e29273a502050c053450483 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+09Apr01=======================================================================
+1. changed lockfile name to cluster.lck (from .lock) for MSWin's benefit
 08Apr01=======================================================================
 1. added a quick installation guide to the admin manual and removed references
 to client.pl (g0vgs)
index fa9e109f56cbe5a1cb3ca8cf7b66307290f1a535..ca73a02ed2ffde0668dd9b4ce7e047a4ce3d3742 100644 (file)
@@ -340,7 +340,7 @@ BEGIN {
        
        # try to detect a lockfile (this isn't atomic but 
        # should do for now
-       $lockfn = "$root/perl/cluster.lock";       # lock file name
+       $lockfn = "$root/perl/cluster.lck";       # lock file name
        if (-e $lockfn) {
                open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
                my $pid = <CLLOCK>;
index 0a66c1db5732a6a2448526ee77d237a734a96026..8a02bfd376adf9110afd20a77363c0f740af1083 100755 (executable)
@@ -25,7 +25,7 @@ BEGIN {
 
        # try to create and lock a lockfile (this isn't atomic but 
        # should do for now
-       my $lockfn = "$root/perl/cluster.lock";       # lock file name
+       $lockfn = "$root/perl/cluster.lck";       # lock file name
        if (-e $lockfn) {
                open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
                my $pid = <CLLOCK>;
@@ -89,7 +89,6 @@ use vars qw(@inqueue $systime $version $starttime $lockfn @outstanding_connects
 $systime = 0;                                  # the time now (in seconds)
 $version = "1.47";                             # the version no of the software
 $starttime = 0;                 # the starting time of the cluster   
-$lockfn = "cluster.lock";       # lock file name
 #@outstanding_connects = ();     # list of outstanding connects
 @listeners = ();                               # list of listeners
 
index 52cd941f779c7b05ec6e9e8ebb2c6221c9f8c493..d600ec6ee623515082fc2f113062882d534d3e85 100755 (executable)
@@ -75,6 +75,15 @@ sub create_it
 
 }
 
+$lockfn = "$root/perl/cluster.lck";       # lock file name
+if (-e $lockfn) {
+       open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
+       my $pid = <CLLOCK>;
+       chomp $pid;
+       die "Sorry, Lockfile ($lockfn) and process $pid exist, a cluster is running\n" if kill 0, $pid;
+       close CLLOCK;
+}
+
 if (-e "$userfn") {
        print "Do you wish to destroy your user database (THINK!!!) [y/N]: ";
        $ans = <STDIN>;
index a3675f813f63ce03753450a28e2aeab5288c557c..4cba9abf4c5d04c343cd24720805694ecbf73fac 100755 (executable)
@@ -82,7 +82,7 @@ sub create_it
 
 }
 
-$lockfn = "$root/perl/cluster.lock";       # lock file name
+$lockfn = "$root/perl/cluster.lck";       # lock file name
 if (-e $lockfn) {
        open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
        my $pid = <CLLOCK>;