Lines 364-382
sub RemovePlugins {
Link Here
|
364 |
sub _restart_after_change { |
364 |
sub _restart_after_change { |
365 |
my ( $class, $params ) = @_; |
365 |
my ( $class, $params ) = @_; |
366 |
|
366 |
|
367 |
if ( C4::Context->psgi_env ) { |
367 |
return unless ( C4::Context->config('plugins_restart') && C4::Context->psgi_env ); |
368 |
my $parent_pid = getpid(); |
368 |
|
369 |
my $ppid = getppid(); # Get the parent process ID |
369 |
my $parent_pid = getpid(); |
370 |
|
370 |
my $ppid = getppid(); # Get the parent process ID |
371 |
# If the current process is not Plack parent, find the parent process recursively |
|
|
372 |
while ( $parent_pid != $ppid ) { |
373 |
$parent_pid = $ppid; |
374 |
$ppid = getppid(); |
375 |
} |
376 |
|
371 |
|
377 |
# Send SIGUSR1 signal to Plack parent process for graceful restart |
372 |
# If the current process is not Plack parent, find the parent process recursively |
378 |
kill 'HUP', $parent_pid; |
373 |
while ( $parent_pid != $ppid ) { |
|
|
374 |
$parent_pid = $ppid; |
375 |
$ppid = getppid(); |
379 |
} |
376 |
} |
|
|
377 |
|
378 |
# Send SIGUSR1 signal to Plack parent process for graceful restart |
379 |
kill 'HUP', $parent_pid; |
380 |
} |
380 |
} |
381 |
|
381 |
|
382 |
1; |
382 |
1; |