]> git.proxmox.com Git - pve-access-control.git/commitdiff
add ability to fork cli workers in background
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 24 Apr 2012 08:10:12 +0000 (10:10 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 24 Apr 2012 08:10:12 +0000 (10:10 +0200)
PVE/RPCEnvironment.pm

index af2eee80e3ce80222595c42a42b238cd528bdbaf..7532e9eca0245dd76f11d75dcd3c9c85081c840f 100644 (file)
@@ -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 {
 # 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);
 
 
     $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} = 
 
     local $SIG{INT} = 
        local $SIG{QUIT} =