if '$sub' dies, the error handler of PVE::Daemon triggers, which
initiates a shutdown of the child, resulting in confusing error logs
(e.g. 'got shutdown request, signal running jobs to stop')
instead, run it under 'eval' and print the error to the sylog instead
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
die "fork failed: $!\n";
} elsif ($child == 0) {
$self->after_fork_cleanup();
- $sub->();
+ eval {
+ $sub->();
+ };
+ if (my $err = $@) {
+ syslog('err', "ERROR: $err");
+ }
POSIX::_exit(0);
}