public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api] pmgtunnel: adapt to read_etc_network_interfaces using run_command
@ 2025-08-18 13:13 Stoiko Ivanov
  2025-08-19  9:57 ` [pmg-devel] applied: " Wolfgang Bumiller
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2025-08-18 13:13 UTC (permalink / raw)
  To: pmg-devel

the changes in pve-common:
346ff97 ("inotify/interfaces: use 'ip link' instead of /proc/net/dev")
made the /etc/network/interfaces parser call `ip link -details` via
run_command. This was the first use of a external command apart from
the ssh processes for the tunnels.

pmgtunnel changed the SIGCHLD handler before entering it's main-loop,
which in turn made run_command return an error on each invocation:
`command 'ip -details -json link show' failed: failed to execute`

The issue is not directly reproducible, as /etc/network/interfaces is
only read if the node-name does not resolv to a non-loopback ip (via
/etc/hosts or DNS).

reported in our community-forum:
https://forum.proxmox.com/threads/.169854/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
minimally tested on a PMG Cluster I have for testing, where I reproduced
this by commenting each node's entry in their /etc/hosts and stopping the
DNS-Server used by the nodes.
 src/PMG/Service/pmgtunnel.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PMG/Service/pmgtunnel.pm b/src/PMG/Service/pmgtunnel.pm
index 513bba0..7b9fa28 100644
--- a/src/PMG/Service/pmgtunnel.pm
+++ b/src/PMG/Service/pmgtunnel.pm
@@ -180,7 +180,10 @@ sub run {
         $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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pmg-devel] applied: [PATCH pmg-api] pmgtunnel: adapt to read_etc_network_interfaces using run_command
  2025-08-18 13:13 [pmg-devel] [PATCH pmg-api] pmgtunnel: adapt to read_etc_network_interfaces using run_command Stoiko Ivanov
@ 2025-08-19  9:57 ` Wolfgang Bumiller
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2025-08-19  9:57 UTC (permalink / raw)
  To: Stoiko Ivanov; +Cc: pmg-devel

applied (yesterday already)
thanks

On Mon, Aug 18, 2025 at 03:13:33PM +0200, Stoiko Ivanov wrote:
> the changes in pve-common:
> 346ff97 ("inotify/interfaces: use 'ip link' instead of /proc/net/dev")
> made the /etc/network/interfaces parser call `ip link -details` via
> run_command. This was the first use of a external command apart from
> the ssh processes for the tunnels.
> 
> pmgtunnel changed the SIGCHLD handler before entering it's main-loop,
> which in turn made run_command return an error on each invocation:
> `command 'ip -details -json link show' failed: failed to execute`
> 
> The issue is not directly reproducible, as /etc/network/interfaces is
> only read if the node-name does not resolv to a non-loopback ip (via
> /etc/hosts or DNS).
> 
> reported in our community-forum:
> https://forum.proxmox.com/threads/.169854/
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> minimally tested on a PMG Cluster I have for testing, where I reproduced
> this by commenting each node's entry in their /etc/hosts and stopping the
> DNS-Server used by the nodes.
>  src/PMG/Service/pmgtunnel.pm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/PMG/Service/pmgtunnel.pm b/src/PMG/Service/pmgtunnel.pm
> index 513bba0..7b9fa28 100644
> --- a/src/PMG/Service/pmgtunnel.pm
> +++ b/src/PMG/Service/pmgtunnel.pm
> @@ -180,7 +180,10 @@ sub run {
>          $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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-19  9:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-18 13:13 [pmg-devel] [PATCH pmg-api] pmgtunnel: adapt to read_etc_network_interfaces using run_command Stoiko Ivanov
2025-08-19  9:57 ` [pmg-devel] applied: " Wolfgang Bumiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal