]> git.proxmox.com Git - pve-cluster.git/commitdiff
pvecm add: fix check if corosync alread runs
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Feb 2017 15:59:04 +0000 (16:59 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 28 Feb 2017 10:38:15 +0000 (11:38 +0100)
`corosync-quorumtool` exit with 1 (CS_OK) if corosync runs and is
quorate.
Use `corosync-quorumtool -l` (list nodes) instead, this returns
1 if corosync does not run
0 if corosync runs, independent if a cluster is quorate or not.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/CLI/pvecm.pm

index a704201407646c3d68fd4f7391e8b22bbf753557..c95e8c6cd6ffc5da63139cdc808ad4a042adeaf0 100755 (executable)
@@ -509,7 +509,7 @@ __PACKAGE__->register_method ({
                die "this host already contains virtual machines - please remove them first\n";
            }
 
-           if (system("corosync-quorumtool >/dev/null 2>&1") == 0) {
+           if (system("corosync-quorumtool -l >/dev/null 2>&1") == 0) {
                die "corosync is already running\n";
            }
        }