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:
parent
5560d9af60
commit
02b1dcc328
1 changed files with 1 additions and 0 deletions
1
FU.pm
1
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue