]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/RPCEnvironment.pm
drop libdigest-hmac-perl dependency
[pve-access-control.git] / PVE / RPCEnvironment.pm
index b3a7dc7ade4072e576e2b0b9b661f9512a6049a5..3ec2c912d220498ca50303e23db5a25e0b67b0c1 100644 (file)
@@ -28,6 +28,7 @@ my $pve_env;
 # that (also see perlipc)
 
 my $WORKER_PIDS;
+my $WORKER_FLAG = 0;
 
 my $log_task_result = sub {
     my ($upid, $user, $status) = @_;
@@ -614,6 +615,10 @@ sub get_user {
     return $self->{user};
 }
 
+sub is_worker {
+    return $WORKER_FLAG;
+}
+
 # read/update list of active workers 
 # we move all finished tasks to the archive index,
 # but keep aktive and most recent task in the active file.
@@ -808,6 +813,7 @@ sub fork_worker {
     if (!$cpid) { # child
 
        $0 = "task $upid";
+       $WORKER_FLAG = 1;
 
        $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { die "received interrupt\n"; };