From: Dietmar Maurer Date: Tue, 24 Apr 2012 08:10:12 +0000 (+0200) Subject: add ability to fork cli workers in background X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=commitdiff_plain;h=3036e8b1be92e855a303769dcda1bbbe901c998a add ability to fork cli workers in background --- diff --git a/PVE/RPCEnvironment.pm b/PVE/RPCEnvironment.pm index af2eee8..7532e9e 100644 --- a/PVE/RPCEnvironment.pm +++ b/PVE/RPCEnvironment.pm @@ -820,14 +820,14 @@ sub check_worker { # STDOUT,STDERR are redirected to the filename returned by upid_decode # NOTE: we simulate running in foreground if ($self->{type} eq 'cli') sub fork_worker { - my ($self, $dtype, $id, $user, $function) = @_; + my ($self, $dtype, $id, $user, $function, $background) = @_; $dtype = 'unknown' if !defined ($dtype); $id = '' if !defined ($id); $user = 'root@pve' if !defined ($user); - my $sync = $self->{type} eq 'cli' ? 1 : 0; + my $sync = ($self->{type} eq 'cli' && !$background) ? 1 : 0; local $SIG{INT} = local $SIG{QUIT} =