Bug 17311 - koha-common service should be restarted on upgrade
Summary: koha-common service should be restarted on upgrade
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Mirko Tietgen
QA Contact: Testopia
URL:
Keywords:
: 17158 (view as bug list)
Depends on: 18250
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-17 11:44 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2023-06-27 20:40 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 17311: koha-common service should be restarted on upgrade (1.53 KB, patch)
2018-05-28 14:13 UTC, Mirko Tietgen
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2016-09-17 11:44:42 UTC
The upgrade process should restart the koha-common service. This is needed so Plack processes are restarted too and Koha version is reloaded (otherwise end users keep getting upgrade messages on the UI.
Any other patched file will be reloaded (apache, zebra, etc).
Comment 1 Mirko Tietgen 2017-03-09 12:29:56 UTC
We should also take care of the correct order of restarting memcached and plack here in some way.
Comment 2 Marcel de Rooy 2017-03-13 13:20:59 UTC
(In reply to Mirko Tietgen from comment #1)
> We should also take care of the correct order of restarting memcached and
> plack here in some way.

Added the see also to bug 18250.
Comment 3 Mirko Tietgen 2018-05-25 17:59:15 UTC
I'll send a patch that stops koha-common in preinst and starts it at the end of postinst. I'd like to do a 18.05.00-2 together with bug 18250.

Together that should take care of stopping, starting memcached, koha-common (incl. plack) and apache.
Comment 4 Mirko Tietgen 2018-05-28 14:13:34 UTC
Created attachment 75590 [details] [review]
Bug 17311: koha-common service should be restarted on upgrade

This patch stops koha-common before upgrades and restarts memcached,
koha-common and apache after upgrades

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Comment 5 Mirko Tietgen 2018-05-28 14:16:56 UTC
Might depend on 18250, as it touches the same file and I made this patch on top of it. Setting it to be on the safe side.
Comment 6 Mirko Tietgen 2018-05-30 13:01:50 UTC
*** Bug 17158 has been marked as a duplicate of this bug. ***
Comment 7 Martin Renvoize (ashimema) 2018-10-08 13:23:53 UTC
Hmmm, would this not also disable the 'Opac Maintenance page' for the duration of the upgrade, which would be undesirable for lengthy DB updates for example?
Comment 8 Tomás Cohen Arazi (tcohen) 2018-10-08 13:27:37 UTC
(In reply to Martin Renvoize from comment #7)
> Hmmm, would this not also disable the 'Opac Maintenance page' for the
> duration of the upgrade, which would be undesirable for lengthy DB updates
> for example?

Maybe if we removed the 'servide koha-common stop' from the preinst file this would keep the spirit, while avoiding the problem you noticed, Martin?
Comment 9 Martin Renvoize (ashimema) 2018-10-08 15:37:13 UTC
I think that would do the trick, yeah. Not sure if there's anything else I'm missing though ;)
Comment 10 Mirko Tietgen 2018-10-11 15:45:55 UTC
Actually… without this patch, koha-common is stopped in prerm, and started in postinst (right before the db upgrade). It's not obvious in our code, it happens during build of the package (dh_installinit resolving the #DEBHELPER# lines).
"koha-common stop" stops plack, so instances using plack are unavailable during unpacking of the new package and deletion of the old files, but should be back before the db upgrade and translation updates.

prerm happens before preinst. We don't need that part in the patch. I'll think about the placement of the other bit.
Comment 11 Tomás Cohen Arazi (tcohen) 2021-01-27 11:06:40 UTC
Is this still relevant?
Comment 12 Aleisha Amohia 2023-06-27 20:40:04 UTC
I think parts of this are still relevant.

The order that services are restarted after an install/upgrade is really important, especially now that Koha uses the background jobs and workers. 

If services are restarted in the wrong order then the worker errors out, writing to the worker-output.log, filling up the disk and bringing down the server.

The services are restarted really nicely and in the correct order in koha testing docker with restart_all, it would be great to have that run when koha-common is installed/upgraded.