[pve-devel] r6499 - in pve-cluster/trunk/data: . PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Aug 19 07:41:34 CEST 2011


Author: dietmar
Date: 2011-08-19 07:41:34 +0200 (Fri, 19 Aug 2011)
New Revision: 6499

Modified:
   pve-cluster/trunk/data/ChangeLog
   pve-cluster/trunk/data/PVE/Cluster.pm
Log:
	* PVE/Cluster.pm (check_cfs_quorum): use 'local' instead of
	'prv/lock', because this link always exists on the file system.



Modified: pve-cluster/trunk/data/ChangeLog
===================================================================
--- pve-cluster/trunk/data/ChangeLog	2011-08-18 12:11:39 UTC (rev 6498)
+++ pve-cluster/trunk/data/ChangeLog	2011-08-19 05:41:34 UTC (rev 6499)
@@ -1,3 +1,8 @@
+2011-08-19  Proxmox Support Team  <support at proxmox.com>
+
+	* PVE/Cluster.pm (check_cfs_quorum): use 'local' instead of
+	'prv/lock', because this link always exists on the file system.
+
 2011-08-18  Proxmox Support Team  <support at proxmox.com>
 
 	* PVE/Cluster.pm (ssh_merge_keys): add check if

Modified: pve-cluster/trunk/data/PVE/Cluster.pm
===================================================================
--- pve-cluster/trunk/data/PVE/Cluster.pm	2011-08-18 12:11:39 UTC (rev 6498)
+++ pve-cluster/trunk/data/PVE/Cluster.pm	2011-08-19 05:41:34 UTC (rev 6499)
@@ -25,13 +25,12 @@
 
 use Data::Dumper; # fixme: remove
 
-my $lockdir = "/etc/pve/priv/lock";
-mkdir $lockdir;
-
 # x509 certificate utils
 
 my $basedir = "/etc/pve";
 my $authdir = "$basedir/priv";
+my $lockdir = "/etc/pve/priv/lock";
+
 my $authprivkeyfn = "$authdir/authkey.key";
 my $authpubkeyfn = "$basedir/authkey.pub";
 my $pveca_key_fn = "$authdir/pve-root-ca.key";
@@ -50,7 +49,6 @@
 my $sshauthkeys = "/etc/pve/priv/authorized_keys";
 my $rootsshauthkeys = "/root/.ssh/authorized_keys";
 
-
 my $observed = {
     'storage.cfg' => 1,
     'datacenter.cfg' => 1,
@@ -86,9 +84,9 @@
 }
 
 sub check_cfs_quorum {
-    # note: -w $lockdir always return 1 for root, so wee need
-    # to use File::stat here
-    my $st = File::stat::stat($lockdir);
+    # note: -w filename always return 1 for root, so wee need
+    # to use File::lstat here
+    my $st = File::stat::lstat("$basedir/local");
     return ($st && (($st->mode & 0200) != 0));
 }
 
@@ -773,6 +771,8 @@
 
     eval {
 
+	mkdir $lockdir;
+
 	if (! -d $lockdir) {
 	    die "$msg: pve cluster filesystem not online.\n";
 	}



More information about the pve-devel mailing list