after forking the actual worker process, the child/worker
sets a flag that can be checked later on by methods called
in the worker.
used in the ZFS storage plugins in pve-storage to decide on
a short or long default timeout for ZFS operations.
# that (also see perlipc)
my $WORKER_PIDS;
# that (also see perlipc)
my $WORKER_PIDS;
my $log_task_result = sub {
my ($upid, $user, $status) = @_;
my $log_task_result = sub {
my ($upid, $user, $status) = @_;
+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.
# 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.
if (!$cpid) { # child
$0 = "task $upid";
if (!$cpid) { # child
$0 = "task $upid";
$SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { die "received interrupt\n"; };
$SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { die "received interrupt\n"; };