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).
We should also take care of the correct order of restarting memcached and plack here in some way.
(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.
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.
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>
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.
*** Bug 17158 has been marked as a duplicate of this bug. ***
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?
(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?
I think that would do the trick, yeah. Not sure if there's anything else I'm missing though ;)
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.
Is this still relevant?
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.