Bug 13784 - Allow running Zebra daemon for disabled instances in packages
Summary: Allow running Zebra daemon for disabled instances in packages
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Larry Baerveldt
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 13785
  Show dependency treegraph
 
Reported: 2015-03-03 15:02 UTC by Larry Baerveldt
Modified: 2015-12-03 22:03 UTC (History)
5 users (show)

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


Attachments
Koha-stop-zebra should also work for disabled instances (1.93 KB, patch)
2015-03-03 15:07 UTC, Larry Baerveldt
Details | Diff | Splinter Review
Koha-stop-zebra should also work for disabled instances (1.99 KB, patch)
2015-03-04 19:00 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 13784: Koha-stop-zebra should also work for disabled instances (2.04 KB, patch)
2015-03-05 04:39 UTC, Robin Sheat
Details | Diff | Splinter Review
Bug 13784: koha-stop-zebra should also work for disabled instances (2.10 KB, patch)
2015-03-07 20:40 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 13784: (QA followup) allow running Zebra for disabled instances on packages (1.35 KB, patch)
2015-03-07 20:40 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 13784: (QA followup) allow running Zebra for disabled instances on packages (2.70 KB, patch)
2015-03-07 20:48 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Larry Baerveldt 2015-03-03 15:02:14 UTC
Patch to come.
Comment 1 Larry Baerveldt 2015-03-03 15:07:53 UTC Comment hidden (obsolete)
Comment 2 Mirko Tietgen 2015-03-03 17:15:47 UTC
Wouldn't it make more sense to make to have koha-disable stop Zebra (if it does not do that atm)? Why would you have Zebra running for disabled instances and need to disable it with koha-stop-zebra?
Comment 3 Robin Sheat 2015-03-04 01:41:16 UTC
(In reply to Mirko Tietgen from comment #2)
> Wouldn't it make more sense to make to have koha-disable stop Zebra (if it
> does not do that atm)? Why would you have Zebra running for disabled
> instances and need to disable it with koha-stop-zebra?

You are correct, but there's also no reason to have it not work if it could be useful in some weird circumstance.
Comment 4 Larry Baerveldt 2015-03-04 08:19:02 UTC
It's not even that weird of a situation. We often need to temporarily block access to a site for both the public catalog and the staff client (such as when performing maintenance, or other actions where we wouldn't want the database to be touched), and disabling the instance is the fastest way to do that, and still present a "maintenance" page to the user. Unless you remember to stop zebra manually first, then if you have already disabled the instance, then you *can't* stop zebra without just killing the processes. This patch addresses that.

Also, I did just submit a patch for koha-disable to stop zebra (and SIP) (see 13785). However, for that patch to work, this one first has to be pushed.
Comment 5 Robin Sheat 2015-03-04 08:42:39 UTC
Well the idea being that if koha-disable stops zebra, then zebra still running would be a weird situation :)

I'm quite happy with all these patches, all going well I'll have a real look at them tomorrow and get them through.
Comment 6 Mirko Tietgen 2015-03-04 19:00:33 UTC Comment hidden (obsolete)
Comment 7 Robin Sheat 2015-03-05 04:39:04 UTC Comment hidden (obsolete)
Comment 8 Tomás Cohen Arazi (tcohen) 2015-03-07 20:40:04 UTC
Created attachment 36728 [details] [review]
Bug 13784: koha-stop-zebra should also work for disabled instances

Currently koha-stop-zebra will not stop zebra for disabled instances. It should
work more like koha-stop-sip, which does work for disabled instances. Also,
koha-stop-zebra is called by '/etc/init.d/koha-common stop' which clearly
should also apply to disabled instances.

To Test:
1) Disable a koha instance.
2) Run koha-stop-zebra INSTANCE. You should get message
   "Instance INSTANCE disabled. No action taken."
3) Apply patch, and copy patched file debian/scripts/koha-stop-zebra
   to package site over /usr/sbin/koha-stop-zebra.
4) Disable koha instance.
5) Run koha-stop-zebra INSTANCE. It should now stop zebra.

http://bugs.koha-community.org/show_bug.cgi?id=13784
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Comment 9 Tomás Cohen Arazi (tcohen) 2015-03-07 20:40:11 UTC Comment hidden (obsolete)
Comment 10 Tomás Cohen Arazi (tcohen) 2015-03-07 20:43:52 UTC
It is not clear to me that we should control disabled instances with /etc/init.d/koha-common as it is a special situation in which you want to run the zebra daemon on a disabled instance. Most people disable an instance and expect is to be off.

I agree with adding some flexibility to the koha-{start|stop|restart}-zebra scripts, but I'm not sure we should change the current behaviour for the init script (i.e. removing --enabled).
Comment 11 Tomás Cohen Arazi (tcohen) 2015-03-07 20:48:57 UTC
Created attachment 36730 [details] [review]
Bug 13784: (QA followup) allow running Zebra for disabled instances on packages

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Comment 12 Tomás Cohen Arazi (tcohen) 2015-03-07 21:13:10 UTC
Patch pushed to master.

Thanks Larry!
Comment 13 Chris Cormack 2015-03-13 22:24:52 UTC
Pushed to 3.18.x will be in 3.18.5
Comment 14 Mason James 2015-03-27 00:53:27 UTC
Pushed to 3.16.x, will be in 3.16.9

nice one Larry :)