Bug 15011

Summary: koha-indexer --stop does not work
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Command-line UtilitiesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: f.demians, robin, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14727
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 15011: koha-indexer should define the --pidfiles on starting the daemon
Bug 15011: koha-indexer should define the --pidfiles on starting the daemon

Description Jonathan Druart 2015-10-14 13:20:10 UTC
root@kohadevbox:~# koha-indexer --start kohadev 
[ ok ] Starting Koha indexing daemon for kohadev:.
root@kohadevbox:~# koha-indexer --stop kohadev 
[FAIL] Error: Indexer not running for kohadev: failed!

root@kohadevbox:~# ps aux | grep zebra
kohadev+   509  0.0  0.0  18596   188 ?        S    11:45   0:00 daemon --name=kohadev-koha-zebra --pidfiles=/var/run/koha/kohadev/ --errlog=/var/log/koha/kohadev/zebra-error.log --stdout=/var/log/koha/kohadev/zebra.log --output=/var/log/koha/kohadev/zebra-output.log --verbose=1 --respawn --delay=30 --user=kohadev-koha.kohadev-koha -- zebrasrv -v none,fatal,warn -f /etc/koha/sites/kohadev/koha-conf.xml
kohadev+   511  0.0  0.8 121780  9148 ?        S    11:45   0:00 zebrasrv -v none,fatal,warn -f /etc/koha/sites/kohadev/koha-conf.xml
kohadev+  3017  0.0  0.0  18596   188 ?        S    11:52   0:00 daemon --name=kohadev-koha-indexer --errlog=/var/log/koha/kohadev/indexer-error.log --stdout=/var/log/koha/kohadev/indexer.log --output=/var/log/koha/kohadev/indexer-output.log --verbose=1 --respawn --delay=30 --user=kohadev-koha.kohadev-koha -- /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -daemon -x -sleep 5
kohadev+  3020  0.8 11.0 341964 113288 ?       S    11:52   0:01 /usr/bin/perl /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -daemon -x -sleep 5
Comment 1 Jonathan Druart 2015-10-14 13:23:55 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi 2015-10-14 13:48:27 UTC
Created attachment 43401 [details] [review]
Bug 15011: koha-indexer should define the --pidfiles on starting the daemon

The --pidfiles options is not provided on starting the daemon and the is_indexer_running consider that the daemon is not running

Test plan:
koha-indexer start
koha-indexer stop

should start and stop the zebra daemon wuthout any error.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested on kohadevbox:ansible

sudo debian/scripts/koha-indexer --stop kohadev
sudo debian/scripts/koha-indexer --start kohadev
sudo debian/scripts/koha-indexer --restart kohadev

All work as expected on the different scenarios.
Comment 3 Tomás Cohen Arazi 2015-11-10 18:24:37 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 4 Frédéric Demians 2015-11-29 20:49:03 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6.