Bugzilla – Attachment 139015 Details for
Bug 21366
Add Plack reload
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21366: Add koha-plack --reload to gracefully restart Plack/Starman
Bug-21366-Add-koha-plack---reload-to-gracefully-re.patch (text/plain), 2.43 KB, created by
Jonathan Druart
on 2022-08-11 07:16:18 UTC
(
hide
)
Description:
Bug 21366: Add koha-plack --reload to gracefully restart Plack/Starman
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-08-11 07:16:18 UTC
Size:
2.43 KB
patch
obsolete
>From 20d86d2fac814a0cfaf47e81f5a2d9013f5531b4 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 11 Aug 2022 05:26:36 +0000 >Subject: [PATCH] Bug 21366: Add koha-plack --reload to gracefully restart > Plack/Starman > >This patch adds a "--reload" option to koha-plack, which allows >a sysadmin to gracefully restart Koha. > >This is very useful when installing Koha plugins or deploying a hot fix >where you need to change code but don't want to interrupt anyone's >usage of Koha. > >0. Apply patch >1. cp /usr/sbin/koha-plack /usr/sbin/koha-plack.bak >2. cp debian/scripts/koha-plack /usr/sbin/koha-plack >3. ps -efww | grep "starman" >4. Now at roughly the same time do the following two actions: > 4a. Go to http://localhost:8081/cgi-bin/koha/about.pl > 4b. koha-plack --reload kohadev >5. Note that the web request completes successfully >6. ps -efww | grep "starman" >7. Note that the "starman master" process stays alive, but the "starman worker" processes have been restarted > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > debian/scripts/koha-plack | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > >diff --git a/debian/scripts/koha-plack b/debian/scripts/koha-plack >index 3dcce331a95..a1a6fed6504 100755 >--- a/debian/scripts/koha-plack >+++ b/debian/scripts/koha-plack >@@ -169,6 +169,26 @@ restart_plack() > fi > } > >+reload_plack() >+{ >+ local instancename=$1 >+ >+ local PIDFILE="/var/run/koha/${instancename}/plack.pid" >+ >+ if is_plack_running ${instancename}; then >+ log_daemon_msg "Reloading Plack daemon for ${instancename}" >+ >+ if start-stop-daemon --pidfile ${PIDFILE} --user="${instancename}-koha" --stop --signal HUP; then >+ log_end_msg 0 >+ else >+ log_end_msg 1 >+ fi >+ else >+ log_daemon_msg "Error: Plack not running for ${instancename}" >+ log_end_msg 1 >+ fi >+} >+ > enable_plack() > { > local instancename=$1 >@@ -360,6 +380,9 @@ _do_instance() { > "restart") > restart_plack $name > ;; >+ "reload") >+ reload_plack $name >+ ;; > "enable") > enable_plack $name > ;; >@@ -398,6 +421,9 @@ while [ $# -gt 0 ]; do > --restart) > set_action "restart" > shift ;; >+ --reload) >+ set_action "reload" >+ shift ;; > --enable) > set_action "enable" > shift ;; >-- >2.25.1
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 21366
:
139011
|
139015
|
139035
|
139565
|
139668
|
139669