public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pmg-api 1/3] pmgpolicy: fix failing run_command in children
@ 2026-06-10 11:35 Dominik Csapak
  2026-06-10 11:35 ` [RFC PATCH pmg-api 2/3] pmgpolicy: mimic Net::Server::PreForkSimple's signal handlers in child Dominik Csapak
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dominik Csapak @ 2026-06-10 11:35 UTC (permalink / raw)
  To: pmg-devel

Net::Server::PreForkSimple installs a handler for that in the parent
which reaps all children automatically with `waitpid(-1, ...)` and this
gets copied over on fork. Normally, the default `run_child` method sets
this back to the default, but in pmgpolicy that is overwritten and not
all signal handlers are set correctly.

This handler with its waitpid will be called before the one in
`run_command` which results in an error there.

To fix this, simply do what the default `run_child` does and set SIGCHLD
to 'DEFAULT'.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/bin/pmgpolicy | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/pmgpolicy b/src/bin/pmgpolicy
index d7d440c..31bffe7 100755
--- a/src/bin/pmgpolicy
+++ b/src/bin/pmgpolicy
@@ -1002,6 +1002,8 @@ sub run_child {
         exit;
     };
 
+    $SIG{'CHLD'} = 'DEFAULT';
+
     delete $prop->{children};
 
     $self->child_init_hook;
-- 
2.47.3





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

end of thread, other threads:[~2026-06-10 12:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10 11:35 [PATCH pmg-api 1/3] pmgpolicy: fix failing run_command in children Dominik Csapak
2026-06-10 11:35 ` [RFC PATCH pmg-api 2/3] pmgpolicy: mimic Net::Server::PreForkSimple's signal handlers in child Dominik Csapak
2026-06-10 11:35 ` [PATCH pmg-api 3/3] Revert "d/control: depend on proxmox-enterprise-support-keyring" Dominik Csapak
2026-06-10 11:37   ` Dominik Csapak
2026-06-10 12:28 ` applied: [PATCH pmg-api 1/3] pmgpolicy: fix failing run_command in children Stoiko Ivanov

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