Bugzilla – Attachment 41512 Details for
Bug 13791
Plack - Out of the box support on packages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13791: make koha-common init script aware of plack
Bug-13791-make-koha-common-init-script-aware-of-pl.patch (text/plain), 4.35 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-08-14 21:45:17 UTC
(
hide
)
Description:
Bug 13791: make koha-common init script aware of plack
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-08-14 21:45:17 UTC
Size:
4.35 KB
patch
obsolete
>From 3e9322da9c4fe4067bbc3e79c93cc60e622e7510 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 13 Aug 2015 14:54:58 -0300 >Subject: [PATCH] Bug 13791: make koha-common init script aware of plack > >This patch makes the packages' koha-common script aware of plack. >It does so by relying on koha-list --plack to know which instances >have Plack configured, and uses the koha-plack script to manage >the running daemons. > >It also introduces a plack_status function to check the status of >the Plack daemon when called: > > $ servive koha-common status > >Regards >--- > debian/koha-common.init | 67 +++++++++++++++++++++++-------------------------- > 1 file changed, 32 insertions(+), 35 deletions(-) > >diff --git a/debian/koha-common.init b/debian/koha-common.init >index 241aaa6..ad41874 100755 >--- a/debian/koha-common.init >+++ b/debian/koha-common.init >@@ -40,6 +40,14 @@ fi > # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. > . /lib/lsb/init-functions > >+# include helper functions >+if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then >+ . "/usr/share/koha/bin/koha-functions.sh" >+else >+ echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 >+ exit 1 >+fi >+ > # > # Function that starts the daemon/service > # >@@ -49,6 +57,7 @@ do_start() > koha-create-dirs $(koha-list) > koha-start-zebra $(koha-list --enabled) > koha-start-sip $(koha-list --enabled) >+ koha-plack --start --quiet $(koha-list --enabled --plack) > > if [ "$USE_INDEXER_DAEMON" = "yes" ]; then > koha-indexer --start --quiet $(koha-list --enabled) >@@ -63,6 +72,7 @@ do_stop() > # We stop everything, including disabled ones. > koha-stop-zebra $(koha-list) || true > koha-stop-sip $(koha-list) || true >+ koha-plack --stop --quiet $(koha-list --enabled --plack) > > if [ "$USE_INDEXER_DAEMON" = "yes" ]; then > koha-indexer --stop --quiet $(koha-list --enabled) >@@ -76,6 +86,7 @@ do_reload() { > koha-restart-zebra $(koha-list --enabled) > koha-stop-sip $(koha-list) || true > koha-start-sip $(koha-list --enabled) >+ koha-plack --restart --quiet $(koha-list --enabled --plack) > > if [ "$USE_INDEXER_DAEMON" = "yes" ]; then > koha-indexer --restart --quiet $(koha-list --enabled) >@@ -83,39 +94,6 @@ do_reload() { > } > > # >-# 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 > # >@@ -123,7 +101,7 @@ zebra_status() > { > for instance in $(koha-list --enabled); do > >- log_daemon_msg "Zebra server running for instace $instance" >+ log_daemon_msg "Zebra server running for instance $instance" > > if is_zebra_running $instance ; then > log_end_msg 0 >@@ -141,7 +119,7 @@ sip_status() > { > for instance in $(koha-list --enabled --sip); do > >- log_daemon_msg "SIP server running for instace $instance" >+ log_daemon_msg "SIP server running for instance $instance" > > if is_sip_running $instance ; then > log_end_msg 0 >@@ -151,6 +129,24 @@ sip_status() > done > } > >+# >+# Function that shows the status of the Plack server daemon for >+# enabled instances >+# >+plack_status() >+{ >+ for instance in $(koha-list --enabled --plack); do >+ >+ log_daemon_msg "Plack server running for instance ${instance}" >+ >+ if is_plack_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" >@@ -192,6 +188,7 @@ case "$1" in > status) > zebra_status > sip_status >+ plack_status > ;; > *) > echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 >-- >2.5.0
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 13791
:
41481
|
41482
|
41483
|
41484
|
41485
|
41486
|
41503
|
41504
|
41505
|
41506
|
41507
|
41508
|
41509
|
41510
|
41511
|
41512
|
41513
|
41563
|
41564
|
41565
|
41566
|
41567
|
41568
|
41571
|
41572
|
41573
|
41574
|
41575
|
41576
|
41748
|
41749
|
41750
|
41751
|
41752
|
41753
|
41866
|
42038