View | Details | Raw Unified | Return to bug 30897
Collapse All | Expand All

(-)a/Koha/Plugins.pm (-11 / +11 lines)
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;
(-)a/debian/templates/koha-conf-site.xml.in (+1 lines)
Lines 409-414 __END_SRU_PUBLICSERVER__ Link Here
409
 <dev_install>0</dev_install>
409
 <dev_install>0</dev_install>
410
 <strict_sql_modes>0</strict_sql_modes>
410
 <strict_sql_modes>0</strict_sql_modes>
411
 <plugins_restricted>1</plugins_restricted>
411
 <plugins_restricted>1</plugins_restricted>
412
 <plugins_restart>0</plugins_restart>
412
 <plugin_repos>
413
 <plugin_repos>
413
    <!--
414
    <!--
414
    <repo>
415
    <repo>
(-)a/etc/koha-conf.xml (+1 lines)
Lines 228-233 Link Here
228
 <dev_install>0</dev_install>
228
 <dev_install>0</dev_install>
229
 <strict_sql_modes>0</strict_sql_modes>
229
 <strict_sql_modes>0</strict_sql_modes>
230
 <plugins_restricted>1</plugins_restricted>
230
 <plugins_restricted>1</plugins_restricted>
231
 <plugins_restart>0</plugins_restart>
231
 <plugin_repos>
232
 <plugin_repos>
232
    <repo>
233
    <repo>
233
        <name>ByWater Solutions</name>
234
        <name>ByWater Solutions</name>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-upload.tt (+5 lines)
Lines 44-49 Link Here
44
                    [% END %]
44
                    [% END %]
45
                </div>
45
                </div>
46
                [% END %]
46
                [% END %]
47
                [% IF ( !plugins_restart ) %]
48
                <div class="dialog alert">
49
                    <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>
50
                </div>
51
                [% END %]
47
                <form method="post" action="/cgi-bin/koha/plugins/plugins-upload.pl" enctype="multipart/form-data">
52
                <form method="post" action="/cgi-bin/koha/plugins/plugins-upload.pl" enctype="multipart/form-data">
48
                    [% INCLUDE 'csrf-token.inc' %]
53
                    [% INCLUDE 'csrf-token.inc' %]
49
                    <fieldset class="brief">
54
                    <fieldset class="brief">
(-)a/plugins/plugins-upload.pl (-1 / +2 lines)
Lines 33-38 use Koha::Plugins; Link Here
33
33
34
my $plugins_enabled    = C4::Context->config("enable_plugins");
34
my $plugins_enabled    = C4::Context->config("enable_plugins");
35
my $plugins_restricted = C4::Context->config("plugins_restricted");
35
my $plugins_restricted = C4::Context->config("plugins_restricted");
36
my $plugins_restart    = C4::Context->config("plugins_restart");
36
37
37
my $input = CGI->new;
38
my $input = CGI->new;
38
my $uploadlocation = $input->param('uploadlocation');
39
my $uploadlocation = $input->param('uploadlocation');
Lines 47-52 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
47
        flagsrequired => { plugins => 'manage' },
48
        flagsrequired => { plugins => 'manage' },
48
    }
49
    }
49
);
50
);
51
$template->param( plugins_restart => $plugins_restart );
50
52
51
# Early exist if uploads are not enabled direct upload attempted when uploads are restricted
53
# Early exist if uploads are not enabled direct upload attempted when uploads are restricted
52
if (!$plugins_enabled) {
54
if (!$plugins_enabled) {
53
- 

Return to bug 30897