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 6A0021FF185 for ; Mon, 18 Aug 2025 20:06:26 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 82AA83E10F; Mon, 18 Aug 2025 20:08:09 +0200 (CEST) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Date: Mon, 18 Aug 2025 20:07:14 +0200 Message-Id: <20250818180714.22846-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1755540415062 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.065 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pmg-devel] [RFC pmg-api] pmgtunnel: do not set SIGCHLD handler X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pmg-devel-bounces@lists.proxmox.com Sender: "pmg-devel" Drop the SIGCHLD handling in pmgtunnel, as it's not necessary and parts deeper in our code-base (e.g. PVE::Tools::run_command) rely on signals not being handled by the callers. In the case of pmgtunnel the signalhander (finish_children) simply wait(2)'s for all children (no matter if it's a ssh-tunnel process, or e.g. `ip link` being called to get network information), and clears the ssh-forwarded postgres socket, schedules a (delayed) restart, and logs an exit message for the ssh-tunnels. all those tasks can happen a synchronously in the main loop in run as well (especially the cleaning of the postgres socket is done directly before running ssh anyways). from a quick look through our perl codebase it seems that this is the only service setting a similar SIGCHLD handler (thus the change in reading/parsing /etc/network/interfaces did not cause issues anywhere else). Suggested-by: Wolfgang Bumiller Signed-off-by: Stoiko Ivanov --- Sending as RFC, as such changes to code that has not been touched in 7+ years might cause regressions, which my testing would not catch. Let this run in my cluster after blocking access between the nodes via netfilter rules - the exiting and logging was the same. src/PMG/Service/pmgtunnel.pm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/PMG/Service/pmgtunnel.pm b/src/PMG/Service/pmgtunnel.pm index 7b9fa28..062e764 100644 --- a/src/PMG/Service/pmgtunnel.pm +++ b/src/PMG/Service/pmgtunnel.pm @@ -173,17 +173,12 @@ sub hup { sub run { my ($self) = @_; - local $SIG{CHLD} = \&finish_children; - for (;;) { # forever $next_update = time() + $updatetime; eval { - # reset SIGCHLD handler as ClusterConfig::new uses run_command (for reading ip link) - $SIG{CHLD} = 'DEFAULT'; my $cinfo = PMG::ClusterConfig->new(); # reload - $SIG{CHLD} = \&finish_children; $self->purge_tunnels($cinfo); $self->start_tunnels($cinfo); }; -- 2.39.5 _______________________________________________ pmg-devel mailing list pmg-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel