Daemon: catch finished worker earlier
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Jan 2015 13:59:04 +0000 (14:59 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Jan 2015 13:59:04 +0000 (14:59 +0100)
Else we get zobies for 5 seconds at restart.

data/PVE/Daemon.pm

index bfab09d..9ba05dc 100644 (file)
@@ -335,7 +335,11 @@ my $server_run = sub {
                &$old_sig_chld(@_) if $old_sig_chld;
            };
 
-           for (;;) { # forever
+           # catch worker finished during restart phase 
+           &$finish_workers($self);
+
+           # now loop forever (until we receive terminate signal)
+           for (;;) { 
                &$start_workers($self);
                sleep(5);
                &$finish_workers($self);