From 5e7031a532b4df6beb475aa3e7e3f6eec29360a6 Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 8 Apr 2001 23:21:28 +0000 Subject: [PATCH] changed lockfile name to .lck (from .lock) for M$ --- Changes | 2 ++ perl/DXUser.pm | 2 +- perl/cluster.pl | 3 +-- perl/create_sysop.pl | 9 +++++++++ perl/update_sysop.pl | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index fefdbcb4..2f05c43d 100644 --- 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) diff --git a/perl/DXUser.pm b/perl/DXUser.pm index fa9e109f..ca73a02e 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -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 = ; diff --git a/perl/cluster.pl b/perl/cluster.pl index 0a66c1db..8a02bfd3 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -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 = ; @@ -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 diff --git a/perl/create_sysop.pl b/perl/create_sysop.pl index 52cd941f..d600ec6e 100755 --- a/perl/create_sysop.pl +++ b/perl/create_sysop.pl @@ -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 = ; + 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 = ; diff --git a/perl/update_sysop.pl b/perl/update_sysop.pl index a3675f81..4cba9abf 100755 --- a/perl/update_sysop.pl +++ b/perl/update_sysop.pl @@ -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 = ; -- 2.34.1