FU: Set $0 when spawning a new worker

This is primarily useful in error state, to avoid having a worker
process waiting for an incoming connection to be marked as the
supervisor.
This commit is contained in:
Yorhel 2025-06-12 09:12:19 +02:00
parent 5560d9af60
commit 02b1dcc328

1
FU.pm
View file

@ -503,6 +503,7 @@ sub _supervisor($c) {
die $! if !defined $pid;
if (!$pid) { # child
$SIG{CHLD} = $SIG{HUP} = $SIG{INT} = $SIG{TERM} = undef;
$0 = sprintf '%s: starting', $procname if $procname;
# In error state, wait with loading the script until we've received a request.
# Otherwise we'll end up in an infinite spawning loop if the script doesn't start properly.
$client = $c->{listen_sock}->accept() or die $! if !$client && $err;