From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id F0DA21FF17A for ; Fri, 18 Jul 2025 18:27:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6626B35BB1; Fri, 18 Jul 2025 18:26:53 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Fri, 18 Jul 2025 18:26:35 +0200 Message-Id: <20250718162638.444705-16-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250718162638.444705-1-s.hanreich@proxmox.com> References: <20250718162638.444705-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.200 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH pve-manager v2 13/16] {sdn, firewall}-commit: wait for quorum X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Since both one-shot services need to wait for quorum, wait for it at the beginning of the scripts, before proceeding with the actual logic. Signed-off-by: Stefan Hanreich Link: https://lore.proxmox.com/20250718123313.208460-3-s.hanreich@proxmox.com --- bin/pve-firewall-commit | 10 ++++++++++ bin/pve-sdn-commit | 10 ++++++++++ services/pve-firewall-commit.service | 2 +- services/pve-sdn-commit.service | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/bin/pve-firewall-commit b/bin/pve-firewall-commit index e0d4eb410..3d208f67b 100644 --- a/bin/pve-firewall-commit +++ b/bin/pve-firewall-commit @@ -3,8 +3,18 @@ use strict; use warnings; +use Time::HiRes qw(usleep); + +use PVE::Cluster; use PVE::INotify; +for (my $i = 0; !PVE::Cluster::check_cfs_quorum(1); $i++) { + print "waiting for pmxcfs mount to appear and get quorate...\n" + if $i % 50 == 0; + + usleep(100 * 1000); +} + my $local_node = PVE::INotify::nodename(); my $current_fw_config_file = "/etc/pve/nodes/$local_node/host.fw"; my $new_fw_config_file = "/etc/pve/nodes/$local_node/host.fw.new"; diff --git a/bin/pve-sdn-commit b/bin/pve-sdn-commit index 479056e25..b174f46d9 100644 --- a/bin/pve-sdn-commit +++ b/bin/pve-sdn-commit @@ -3,8 +3,18 @@ use strict; use warnings; +use Time::HiRes qw(usleep); + +use PVE::Cluster; use PVE::Network::SDN; +for (my $i = 0; !PVE::Cluster::check_cfs_quorum(1); $i++) { + print "waiting for pmxcfs mount to appear and get quorate...\n" + if $i % 50 == 0; + + usleep(100 * 1000); +} + PVE::Network::SDN::commit_config(); PVE::Network::SDN::generate_zone_config(); diff --git a/services/pve-firewall-commit.service b/services/pve-firewall-commit.service index 77ea095d7..454ef6c2e 100644 --- a/services/pve-firewall-commit.service +++ b/services/pve-firewall-commit.service @@ -2,7 +2,7 @@ Description=Commit Proxmox VE Firewall changes DefaultDependencies=no Wants=pve-cluster.service -After=pve-cluster.service +After=corosync.service [Service] ExecStart=/usr/share/pve-manager/helpers/pve-firewall-commit diff --git a/services/pve-sdn-commit.service b/services/pve-sdn-commit.service index 927d06c54..ff723725d 100644 --- a/services/pve-sdn-commit.service +++ b/services/pve-sdn-commit.service @@ -2,7 +2,7 @@ Description=Commit Proxmox VE SDN changes DefaultDependencies=no Wants=pve-cluster.service network.target -After=frr.service network.target pve-cluster.service +After=frr.service network.target corosync.service [Service] ExecStart=/usr/share/pve-manager/helpers/pve-sdn-commit -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel