Bugzilla – Attachment 21513 Details for
Bug 10624
koha-common.init should implement the 'status' option switch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Added the PID parameter to daemon as it failed to check SIP servers were running otherwise.
Bug-10624-status-option-switch-for-the-packages-in.patch (text/plain), 3.34 KB, created by
Tomás Cohen Arazi (tcohen)
on 2013-09-27 14:37:49 UTC
(
hide
)
Description:
Added the PID parameter to daemon as it failed to check SIP servers were running otherwise.
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2013-09-27 14:37:49 UTC
Size:
3.34 KB
patch
obsolete
>From 26fbb03804ee977049c2c135a71fb8c0d47d79b6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Fri, 30 Aug 2013 13:17:55 -0300 >Subject: [PATCH] Bug 10624: 'status' option switch for the packages init > script > >This patch makes the init script return the status of the relevant processes. >It relies on the koha-list switches added by 10622, and is written on top of the patch from 10617 that cleaned the init script. > >To test: >- Apply the patch (+ 10622 so the SIP part works), build package and install >- Run > $ service koha-common status > >Note: it can be tested just copying the debian/koha-common.init script to a server running koha-common instances and calling it > $ ./koha-common.init status > >If you don't have a patched koha-list command it will fail to report SIP servers status. > >Regards >To+ > >Edit: added the PID parameter to daemon as it failed to check SIP servers were running otherwise. > >Sponsored-by: Universidad Nacional de Cordoba >--- > debian/koha-common.init | 80 +++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 74 insertions(+), 6 deletions(-) > >diff --git a/debian/koha-common.init b/debian/koha-common.init >index 38eafcf..94a7939 100755 >--- a/debian/koha-common.init >+++ b/debian/koha-common.init >@@ -70,6 +70,75 @@ do_reload() { > koha-start-sip $(koha-list --enabled) > } > >+# >+# Function that checks zebrasrv is running for the specified instance >+# >+is_zebra_running() >+{ >+ local instancename=$1 >+ >+ if daemon --name="$instancename-koha-zebra" \ >+ --user="$instancename-koha.$instancename-koha" \ >+ --running ; then >+ return 0 >+ else >+ return 1 >+ fi >+} >+ >+# >+# Function that checks SIP server is running for the specified instance >+# >+is_sip_running() >+{ >+ local instancename=$1 >+ >+ if daemon --name="$instancename-koha-sip" \ >+ --pidfiles="/var/run/koha/$instancename" \ >+ --user="$instancename-koha.$instancename-koha" \ >+ --running ; then >+ return 0 >+ else >+ return 1 >+ fi >+} >+ >+# >+# Function that shows the status of the zebrasrv daemon for >+# enabled instances >+# >+zebra_status() >+{ >+ for instance in $(koha-list --enabled); do >+ >+ log_daemon_msg "Zebra server running for instace $instance" >+ >+ if is_zebra_running $instance ; then >+ log_end_msg 0 >+ else >+ log_end_msg 1 >+ fi >+ done >+} >+ >+# >+# Function that shows the status of the SIP server daemon for >+# enabled instances >+# >+sip_status() >+{ >+ for instance in $(koha-list --enabled --sip); do >+ >+ log_daemon_msg "SIP server running for instace $instance" >+ >+ if is_sip_running $instance ; then >+ log_end_msg 0 >+ else >+ log_end_msg 1 >+ fi >+ done >+} >+ > case "$1" in > start) > [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" >@@ -108,13 +177,12 @@ case "$1" in > ;; > esac > ;; >-# TODO: Implement this. It should check every daemon is running >-# status) >-# status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? >-# ;; >+ status) >+ zebra_status >+ sip_status >+ ;; > *) >- #echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 >- echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 >+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 > exit 3 > ;; > esac >-- >1.7.9.5
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 10624
:
20746
|
21242
|
21513
|
21706