From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 02B2E1FF17A for ; Fri, 18 Jul 2025 14:32:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 58C9D1D8FE; Fri, 18 Jul 2025 14:33:17 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Fri, 18 Jul 2025 14:33:12 +0200 Message-Id: <20250718123313.208460-3-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250718123313.208460-1-s.hanreich@proxmox.com> References: <20250718123313.208460-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.207 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [network.target, fw.new] Subject: [pve-devel] [PATCH pve-manager 2/3] {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 --- 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 09e4387c5..7536608d6 100644 --- a/bin/pve-sdn-commit +++ b/bin/pve-sdn-commit @@ -3,9 +3,19 @@ use strict; use warnings; +use Time::HiRes qw(usleep); + +use PVE::Cluster; use PVE::Network::SDN; use PVE::Tools; +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 $previous_config_has_frr = PVE::Network::SDN::running_config_has_frr(); PVE::Network::SDN::commit_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