@@ -, +, @@ zebrasrv --------- -- the zebrasrv and daemon process for zebra indexing didn't restart. -- the processes should have started up again. -- the process ids for the zebrasrv and daemon processes should be different, but the number of processes is the same as before. --- debian/scripts/koha-stop-zebra | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) --- a/debian/scripts/koha-stop-zebra +++ a/debian/scripts/koha-stop-zebra @@ -31,15 +31,42 @@ stop_zebra_instance() local instancename=$1 echo "Stopping Zebra server for $instancename" + + # both daemon and zebrasrv processes for one instance + # will go away, but there could be other processes + # for other instances. + expecting=`ps aux | grep zebra | wc -l` + expecting=$((expecting-2)) + + # Issue command to stop the zebra server daemon \ --name="$instancename-koha-zebra" \ --pidfiles="/var/run/koha/$instancename/" \ --user="$instancename-koha.$instancename-koha" \ --stop \ -- \ - zebrasrv \ - return 0 || \ + zebrasrv + + # If it doesn't return nicely, return 1 for bad. + if [ $? -ne 0 ]; then return 1 + fi + + # Now actually wait a bit. But not forever. + count=0 + check=$((expecting+2)) + while ( [ $count -lt 10 ] && [ $check -gt $expecting ] ); do + count=$((count+1)) + # Recount the zebra related processes + check=`ps aux | grep zebra | wc -l` + done + + # return 1 for 10 loops of not stopped yet. + if [ $check -ne $expecting ]; then + return 1 + else + return 0 + fi } usage() --