Daemon: correctly set got_hup_signal flag (before we call terminate)
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Jan 2015 09:57:10 +0000 (10:57 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 1 Jan 2015 09:57:10 +0000 (10:57 +0100)
data/PVE/Daemon.pm

index 1436f17..448f881 100644 (file)
@@ -299,9 +299,9 @@ my $server_run = sub {
     $SIG{HUP} = sub {
        local ($@, $!, $?); # do not overwrite error vars
        syslog('info', "received signal HUP");
+       $self->{got_hup_signal} = 1;
        if ($self->{max_workers}) {
            &$terminate_server($self);
-           $self->{got_hup_signal} = 1;
        } elsif ($self->can('hup')) {
            eval { $self->hup() };
            warn $@ if $@;