]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Daemon.pm
PVE::CLIFormatter::extract_properties_to_print - new helper
[pve-common.git] / src / PVE / Daemon.pm
index ee3c67c4d4895fb6bcbae008946f7228263a619f..dcc4d340eef8b3c1cad36f9f224b79c9cbfca8ea 100644 (file)
@@ -201,7 +201,7 @@ my $terminate_server = sub {
     return if $allow_open_children && $self->{leave_children_open_on_reload};
 
     # else send TERM to all (old and current) child workers
-    kill 15, keys %{$self->@{'workers','old_workers'}};
+    kill 15, (keys %{$self->{workers}}, keys %{$self->{old_workers}});
 
     # nicely shutdown childs (give them max 10 seconds to shut down)
     my $previous_alarm = alarm(10);
@@ -280,7 +280,12 @@ sub setup {
 
     if ($restart && $self->{max_workers}) {
        if (my $wpids = $ENV{PVE_DAEMON_WORKER_PIDS}) {
-           $self->{old_workers}->{$_} = 1 foreach (split(':', $wpids));
+           foreach my $pid (split(':', $wpids)) {
+               # check & untaint
+               if ($pid =~ m/^(\d+)$/) {
+                   $self->{old_workers}->{$1} = 1;
+               }
+           }
        }
     }