X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FRESTEnvironment.pm;fp=src%2FPVE%2FRESTEnvironment.pm;h=ebf8a2e7aaaadc8e88b50929b8f15e6e00e98dbd;hp=871f12ba9b25549be1abe2a82893545e0ecb591d;hb=2311859b0da26e1806f5015783bfebb5aca16300;hpb=4d9f4d62e416b0080ccd223c553a967e051d4bab diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm index 871f12b..ebf8a2e 100644 --- a/src/PVE/RESTEnvironment.pm +++ b/src/PVE/RESTEnvironment.pm @@ -561,15 +561,17 @@ sub fork_worker { POSIX::write($psync[1], $upid, length ($upid)); POSIX::close($psync[1]) if !$sync; # don't need output pipe if async - my $readbuf = ''; - # sync with parent (wait until parent is ready) - POSIX::read($csync[0], $readbuf, 4096); - die "parent setup error\n" if $readbuf ne 'OK'; + eval { + my $readbuf = ''; + # sync with parent (wait until parent is ready) + POSIX::read($csync[0], $readbuf, 4096); + die "parent setup error\n" if $readbuf ne 'OK'; - if ($self->{type} eq 'ha') { - print "task started by HA resource agent\n"; - } - eval { &$function($upid); }; + if ($self->{type} eq 'ha') { + print "task started by HA resource agent\n"; + } + &$function($upid); + }; my $err = $@; if ($err) { chomp $err;