Bug 30897: Limit to plack environments

I had a feeling we'd want to do this when I submitted the proof of
concept, though I hadn't appreciated the wider issues that have now been
highlighted.. it makes a lot of sense to limit to the plack scope.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-04-11 07:52:53 +02:00 committed by Katrin Fischer
parent 0a0487d884
commit 57ee369e90
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 11 additions and 9 deletions

View File

@ -364,17 +364,19 @@ sub RemovePlugins {
sub _restart_after_change {
my ( $class, $params ) = @_;
my $parent_pid = getpid();
my $ppid = getppid(); # Get the parent process ID
if ( C4::Context->psgi_env ) {
my $parent_pid = getpid();
my $ppid = getppid(); # Get the parent process ID
# If the current process is not Plack parent, find the parent process recursively
while ($parent_pid != $ppid) {
$parent_pid = $ppid;
$ppid = getppid();
# If the current process is not Plack parent, find the parent process recursively
while ( $parent_pid != $ppid ) {
$parent_pid = $ppid;
$ppid = getppid();
}
# Send SIGUSR1 signal to Plack parent process for graceful restart
kill 'HUP', $parent_pid;
}
# Send SIGUSR1 signal to Plack parent process for graceful restart
kill 'HUP', $parent_pid;
}
1;