Bugzilla – Attachment 53926 Details for
Bug 16885
koha-stop-zebra should be more sure of stopping zebrasrv
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16885: koha-stop-zebra should be more sure of stopping zebrasrv
Bug-16885-koha-stop-zebra-should-be-more-sure-of-s.patch (text/plain), 2.62 KB, created by
Mark Tompsett
on 2016-08-03 04:13:33 UTC
(
hide
)
Description:
Bug 16885: koha-stop-zebra should be more sure of stopping zebrasrv
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2016-08-03 04:13:33 UTC
Size:
2.62 KB
patch
obsolete
>From a5f097f98806c95730be5d62417589d736256ca8 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Tue, 2 Aug 2016 23:26:03 -0400 >Subject: [PATCH] Bug 16885: koha-stop-zebra should be more sure of stopping > zebrasrv > >This patch actually loops 10 tens to check, before giving up. > >TEST PLAN >--------- >1) Back up your koha logs as desired. >2) add something to /var/log/koha/{instance name}/intranet-error.log >3) ps aux | grep zebra >4) logrotate -f /etc/logrotate.d/koha-common >5) ps aux | grep zebra > -- the zebrasrv and daemon process for zebra indexing > didn't restart. >6) apply this patch against /usr/sbin/koha-stop-zebra >7) sudo koha-start-zebra {instance name} >8) ps aux | grep zebra > -- the processes should have started up again. >9) add different junk to /var/log/koha/{instance name}/intranet-error.log >10) ps aux | grep zebra >11) logrotate -f /etc/logrotate.d/koha-common >12) ps aux | grep zebra > -- the process ids for the zebrasrv and daemon processes should > be different, but the number of processes is the same as before. >13) sign off, because its less ugly than comment #3 > >Sponsored-by: Tulong Aklatan >--- > debian/scripts/koha-stop-zebra | 31 +++++++++++++++++++++++++++++-- > 1 file changed, 29 insertions(+), 2 deletions(-) > >diff --git a/debian/scripts/koha-stop-zebra b/debian/scripts/koha-stop-zebra >index a584ca1..57d093f 100755 >--- a/debian/scripts/koha-stop-zebra >+++ b/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() >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16885
:
53925
|
53926
|
53958
|
54314
|
54373