Bugzilla – Attachment 164662 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: Add option to disable automated restart
Bug-30897-Add-option-to-disable-automated-restart.patch (text/plain), 4.44 KB, created by
Martin Renvoize (ashimema)
on 2024-04-11 08:38:01 UTC
(
hide
)
Description:
Bug 30897: Add option to disable automated restart
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-11 08:38:01 UTC
Size:
4.44 KB
patch
obsolete
>From dbcee33730e773ee1f93b6ea5b2d01591cf7ae28 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 11 Apr 2024 10:28:07 +0200 >Subject: [PATCH] Bug 30897: Add option to disable automated restart > >This patch adds the ability to disable the automated plack restart we >introduce with this patchset via configuration. >--- > Koha/Plugins.pm | 22 +++++++++---------- > debian/templates/koha-conf-site.xml.in | 1 + > etc/koha-conf.xml | 1 + > .../prog/en/modules/plugins/plugins-upload.tt | 5 +++++ > plugins/plugins-upload.pl | 2 ++ > 5 files changed, 20 insertions(+), 11 deletions(-) > >diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm >index 0ffee023f89..88c51a5e6f4 100644 >--- a/Koha/Plugins.pm >+++ b/Koha/Plugins.pm >@@ -364,19 +364,19 @@ sub RemovePlugins { > sub _restart_after_change { > my ( $class, $params ) = @_; > >- 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(); >- } >+ return unless ( C4::Context->config('plugins_restart') && C4::Context->psgi_env ); >+ >+ my $parent_pid = getpid(); >+ my $ppid = getppid(); # Get the parent process ID > >- # Send SIGUSR1 signal to Plack parent process for graceful restart >- kill 'HUP', $parent_pid; >+ # 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; > } > > 1; >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index c35b6d84325..b4e3c71ba21 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -409,6 +409,7 @@ __END_SRU_PUBLICSERVER__ > <dev_install>0</dev_install> > <strict_sql_modes>0</strict_sql_modes> > <plugins_restricted>1</plugins_restricted> >+ <plugins_restart>0</plugins_restart> > <plugin_repos> > <!-- > <repo> >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index f7cdd2f8d00..bcdd959c12b 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -228,6 +228,7 @@ > <dev_install>0</dev_install> > <strict_sql_modes>0</strict_sql_modes> > <plugins_restricted>1</plugins_restricted> >+ <plugins_restart>0</plugins_restart> > <plugin_repos> > <repo> > <name>ByWater Solutions</name> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-upload.tt >index 5866f75deda..b0f5a7ceb95 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-upload.tt >@@ -44,6 +44,11 @@ > [% END %] > </div> > [% END %] >+ [% IF ( !plugins_restart ) %] >+ <div class="dialog alert"> >+ <strong>You're system is not configured to automatically refresh on plugin upload, you may need to ask your administrator to complete the plugin installation.</strong> >+ </div> >+ [% END %] > <form method="post" action="/cgi-bin/koha/plugins/plugins-upload.pl" enctype="multipart/form-data"> > [% INCLUDE 'csrf-token.inc' %] > <fieldset class="brief"> >diff --git a/plugins/plugins-upload.pl b/plugins/plugins-upload.pl >index f17a70422e9..b158f51662f 100755 >--- a/plugins/plugins-upload.pl >+++ b/plugins/plugins-upload.pl >@@ -33,6 +33,7 @@ use Koha::Plugins; > > my $plugins_enabled = C4::Context->config("enable_plugins"); > my $plugins_restricted = C4::Context->config("plugins_restricted"); >+my $plugins_restart = C4::Context->config("plugins_restart"); > > my $input = CGI->new; > my $uploadlocation = $input->param('uploadlocation'); >@@ -47,6 +48,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > flagsrequired => { plugins => 'manage' }, > } > ); >+$template->param( plugins_restart => $plugins_restart ); > > # Early exist if uploads are not enabled direct upload attempted when uploads are restricted > if (!$plugins_enabled) { >-- >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