The test at line 220 in koha-indexer creates an error since it isn't treating $INDEXER_PARAMS as a string. For example: /usr/sbin/koha-indexer: line 220: [: -sleep: binary operator expected
Steps to recreate please? In ktd: % koha-indexer --restart kohadev Restarting Koha indexing daemon for kohadev:. => it works
Steps to reproduce: 1. vi /etc/default/koha-common 2. Add the following to the bottom of the file: INDEXER_PARAMS="-daemon -sleep $INDEXER_TIMEOUT" 3. koha-indexer --stop kohadev 4. Note the following error: /usr/sbin/koha-indexer: line 220: [: too many arguments
Created attachment 114902 [details] [review] Bug 27348: Fix test on INDEXER_PARAMS in koha-indexer koha-indexer doesn't test INDEXER_PARAMS correctly which causes errors to display when stopping/starting the daemon. This patch fixes the test so that the variable is tested as a string, so that no errors are created and the params are passed correctly. Test plan: 0. Apply patch 1. vi /etc/default/koha-common 2. Add the following to the bottom of the file: INDEXER_PARAMS="-daemon -sleep 6" 3. cp debian/scripts/koha-indexer /usr/sbin/koha-indexer 4. koha-indexer --stop kohadev 5. Note no errors 6. koha-indexer --start kohadev 7. Note no errors 8. ps -efww | grep "indexer" 9. Note that rebuild_zebra.pl has the arguments "-daemon -sleep 6"
Shouldn't we add the quote for $ALTERNATE_INDEXER_DAEMON as well? It won't hurt :)
Created attachment 114903 [details] [review] Bug 27348: Fix test on ALTERNATE_INDEXER_DAEMON in koha-indexer
We should also use -z for the DEV_INSTALL test 208 if [ "$DEV_INSTALL" = "" ]; then For later...
(In reply to Jonathan Druart from comment #4) > Shouldn't we add the quote for $ALTERNATE_INDEXER_DAEMON as well? > It won't hurt :) Probably wise. You never know when someone is going to put spaces in their filepath and cause problems.
Created attachment 121620 [details] [review] Bug 27348: Fix test on INDEXER_PARAMS in koha-indexer koha-indexer doesn't test INDEXER_PARAMS correctly which causes errors to display when stopping/starting the daemon. This patch fixes the test so that the variable is tested as a string, so that no errors are created and the params are passed correctly. Test plan: 0. Apply patch 1. vi /etc/default/koha-common 2. Add the following to the bottom of the file: INDEXER_PARAMS="-daemon -sleep 6" 3. cp debian/scripts/koha-indexer /usr/sbin/koha-indexer 4. koha-indexer --stop kohadev 5. Note no errors 6. koha-indexer --start kohadev 7. Note no errors 8. ps -efww | grep "indexer" 9. Note that rebuild_zebra.pl has the arguments "-daemon -sleep 6" Signed-off-by: David Nind <david@davidnind.com>
Created attachment 121621 [details] [review] Bug 27348: Fix test on ALTERNATE_INDEXER_DAEMON in koha-indexer Signed-off-by: David Nind <david@davidnind.com>
Created attachment 121861 [details] [review] Bug 27348: Fix test on INDEXER_PARAMS in koha-indexer koha-indexer doesn't test INDEXER_PARAMS correctly which causes errors to display when stopping/starting the daemon. This patch fixes the test so that the variable is tested as a string, so that no errors are created and the params are passed correctly. Test plan: 0. Apply patch 1. vi /etc/default/koha-common 2. Add the following to the bottom of the file: INDEXER_PARAMS="-daemon -sleep 6" 3. cp debian/scripts/koha-indexer /usr/sbin/koha-indexer 4. koha-indexer --stop kohadev 5. Note no errors 6. koha-indexer --start kohadev 7. Note no errors 8. ps -efww | grep "indexer" 9. Note that rebuild_zebra.pl has the arguments "-daemon -sleep 6" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 121862 [details] [review] Bug 27348: Fix test on ALTERNATE_INDEXER_DAEMON in koha-indexer Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.02
Pushed to 20.11.x for 20.11.09
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.