Bugzilla – Attachment 164661 Details for
Bug 30897
Gracefully reload Koha after plugin install/upgrade
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30897: Limit to plack environments
Bug-30897-Limit-to-plack-environments.patch (text/plain), 1.61 KB, created by
Martin Renvoize (ashimema)
on 2024-04-11 08:37:57 UTC
(
hide
)
Description:
Bug 30897: Limit to plack environments
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-11 08:37:57 UTC
Size:
1.61 KB
patch
obsolete
>From aa6a2c4af70608a1e09d309724405c95fa8f9b04 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 11 Apr 2024 07:52:53 +0200 >Subject: [PATCH] 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. >--- > Koha/Plugins.pm | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > >diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm >index 94ff5e991a5..0ffee023f89 100644 >--- a/Koha/Plugins.pm >+++ b/Koha/Plugins.pm >@@ -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 the current process is not Plack parent, find the parent process recursively >- while ($parent_pid != $ppid) { >- $parent_pid = $ppid; >- $ppid = getppid(); >- } >+ 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(); >+ } > >- # 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; >-- >2.44.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30897
:
164587
|
164588
|
164654
|
164655
|
164657
|
164658
|
164660
|
164661
|
164662
|
164663
|
164735
|
164736
|
164737
|
164738
|
164758