From 02b1dcc328bb4bedbe35d29a2f5688b8e3769913 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Thu, 12 Jun 2025 09:12:19 +0200 Subject: [PATCH] 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. --- FU.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/FU.pm b/FU.pm index 4b0dfed..2b9244e 100644 --- a/FU.pm +++ b/FU.pm @@ -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;