Bug 13753 - INDEXER_DAEMON default is incorrect in koha-indexer
Summary: INDEXER_DAEMON default is incorrect in koha-indexer
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All Linux
: P5 - low major (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-24 13:10 UTC by Ivan Brown
Modified: 2015-12-03 22:02 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13753: koha-indexer contains invalid statement (1.30 KB, patch)
2015-02-24 14:00 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 13753: koha-indexer contains invalid statement (1.36 KB, patch)
2015-02-25 16:29 UTC, Mirko Tietgen
Details | Diff | Splinter Review
[PASSED QA] Bug 13731: Suggestions reason does not save on updating the status (1.87 KB, patch)
2015-03-02 11:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 13753: koha-indexer contains invalid statement (1.42 KB, patch)
2015-03-02 11:48 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Brown 2015-02-24 13:10:53 UTC
After upgrading to Koha 3.18 I thought I'd try the new daemon indexing as our librarian is always complaining about the delay before things appear in searches.

I followed the instructions at http://wiki.koha-community.org/wiki/PackagesIndexDaemon to enable it but it did not seem to be working.

Looking at ps output to see if it was running I noticed something strange:

lcs-koha   947  0.0  0.0  17176   712 ?        S    Feb06   0:58 daemon --name=lcs-koha-indexer --errlog=/var/log/koha/lcs/indexer-error.log --stdout=/var/log/koha/lcs/indexer.log --output=/var/log/koha/lcs/indexer-output.log --verbose=1 --respawn --delay=30 --user=lcs-koha.lcs-koha -- -daemon -x -sleep 5

The executable name seemed to be missing.

Further investigation led me to /usr/sbin/koha-indexer line 177:

# Check if an alternate indexer has been set
if [ -z $ALTERNATE_INDEXER_DAEMON ]; then
    INDEXER_DAEMON="$ALTERNATE_INDEXER_DAEMON"
else
    # We default to rebuild_zebra.pl if no alternate indexer set
    INDEXER_DAEMON="${KOHA_HOME}/bin/migration_tools/rebuild_zebra.pl"
fi

Surely this means that if the INDEXER_DAEMON is zero length then set it to the zero length string! The default daemon program is never set. The INDEXER_DAEMON assigments should be swapped.

I'm surprised no one else has reported this but I can't find any other bug reports.
Comment 1 Tomás Cohen Arazi 2015-02-24 14:00:30 UTC Comment hidden (obsolete)
Comment 2 Mirko Tietgen 2015-02-25 16:29:29 UTC Comment hidden (obsolete)
Comment 3 Mirko Tietgen 2015-02-25 16:30:59 UTC
Not in the scope of this patch: I had to manually start koha-indexer. That is neither mentioned here nor on the Wiki, so I wonder if it is supposed to run automatically?
Comment 4 Tomás Cohen Arazi 2015-02-27 11:39:29 UTC
(In reply to Mirko Tietgen from comment #3)
> Not in the scope of this patch: I had to manually start koha-indexer. That
> is neither mentioned here nor on the Wiki, so I wonder if it is supposed to
> run automatically?

Mirko, have you set /etc/default/koha-common ? And restarted the koha-common service?
Comment 5 Mirko Tietgen 2015-02-27 11:49:34 UTC
(In reply to Tomás Cohen Arazi from comment #4)
> (In reply to Mirko Tietgen from comment #3)
> > Not in the scope of this patch: I had to manually start koha-indexer. That
> > is neither mentioned here nor on the Wiki, so I wonder if it is supposed to
> > run automatically?
> 
> Mirko, have you set /etc/default/koha-common ? And restarted the koha-common
> service?

Yes, I did.
Comment 6 Mirko Tietgen 2015-02-27 15:28:13 UTC
(In reply to Mirko Tietgen from comment #5)
> (In reply to Tomás Cohen Arazi from comment #4)
> > (In reply to Mirko Tietgen from comment #3)
> > > Not in the scope of this patch: I had to manually start koha-indexer. That
> > > is neither mentioned here nor on the Wiki, so I wonder if it is supposed to
> > > run automatically?
> > 
> > Mirko, have you set /etc/default/koha-common ? And restarted the koha-common
> > service?
> 
> Yes, I did.

Sorry, I did not read carefully. I set /etc/koha/koha-common.conf. I did not set /etc/default/koha-common as it was not mentioned in the wiki.
Comment 7 Katrin Fischer 2015-03-02 11:44:53 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2015-03-02 11:48:20 UTC
Created attachment 36286 [details] [review]
[PASSED QA] Bug 13753: koha-indexer contains invalid statement

An incorrect conditional makes the indexer daemon fail to load.

To test:
- Enable the indexer daemon on packages [1]
- Restart koha-common:
  $ service koha-common restart
- Run
  $ ps waux | grep koha-indexer
=> FAIL: there's no reference to the rebuild_zebra.pl script
  (line should look like *rebuild_zebra.pl -daemon*)
   Run ps -ef | grep rebuild_zebra.pl too to make sure.
- Apply the patch, repeat the steps
=> SUCCESS: the rebuild_zebra.pl script is ran
- Sign off :-D

Thanks

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 9 Tomás Cohen Arazi 2015-03-02 15:28:02 UTC
Patch pushed to master.
Comment 10 Chris Cormack 2015-03-12 07:03:40 UTC
Pushed to 3.18.x will be in 3.18.5