Bug 21366: Add koha-plack --reload to gracefully restart Plack/Starman
authorDavid Cook <dcook@prosentient.com.au>
Thu, 11 Aug 2022 05:26:36 +0000 (05:26 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 26 Aug 2022 18:52:02 +0000 (15:52 -0300)
commite0f1110389055b7a2fab960d398c04f895586120
treed1167699edc6d36ebb3d5dc43fa1894e0cc2ec42
parent89e890e7ce21b872574bf7c14d4a75dd2aebb3a1
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>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
debian/scripts/koha-plack