Bugzilla – Attachment 12248 Details for
Bug 8773
Add per-instance koha-index-daemon in .deb setup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8773 - Start per-instance koha-index-daemon in .deb setup
Bug-8773---Start-per-instance-koha-index-daemon-in.patch (text/plain), 8.92 KB, created by
Tomás Cohen Arazi (tcohen)
on 2012-09-14 18:37:00 UTC
(
hide
)
Description:
Bug 8773 - Start per-instance koha-index-daemon in .deb setup
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2012-09-14 18:37:00 UTC
Size:
8.92 KB
patch
obsolete
>From 980b6fb3cb239aa658b89f87b6674b531aeb10e4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Fri, 14 Sep 2012 15:26:12 -0300 >Subject: [PATCH] Bug 8773 - Start per-instance koha-index-daemon in .deb > setup >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit >Content-Type: text/plain; charset="utf-8" > >This bug is the .deb version of 8519 [1]. It is motivated by the fact that >using 1-minute (or more) frecquency cronjobs to do the incremental >indexing of records does not scale for us, nor is accepted by our >librarians. > >Using an indexing daemon avoids launching a new interpreter each time >the cron triggers the indexing, and also allows sub-minute reindexing. >Frecquency is hardcoded right now. A follow up could provide a way >to set it for each instance. > >This patch relies on Koha::Contrib::Tamil's koha-index-daemon script [2], >but could be easily adjusted to use another if we got a new one (SolR?). > >I havent got the time to setup my infrastructure to generate my own debs, >and thus haven't got the oportunity to test this patch. If anyone with the >skills helps me on setting that I could test them and fix possible issues. > >If there's something I could change to make this patches better just let me know. > >Regards >To+ > >[1] http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8519 >[2] The default cronjob that is set using the debian/koha-common.cron.d file >is being disbaled by this patch to avoid collision. > >Sponsored-by: Universidad Nacional de Córdoba >--- > debian/koha-common.cron.d | 2 +- > debian/koha-common.init | 3 +++ > debian/scripts/koha-restart-indexer | 50 +++++++++++++++++++++++++++++++++++ > debian/scripts/koha-start-indexer | 50 +++++++++++++++++++++++++++++++++++ > debian/scripts/koha-stop-indexer | 50 +++++++++++++++++++++++++++++++++++ > 5 files changed, 154 insertions(+), 1 deletion(-) > create mode 100755 debian/scripts/koha-restart-indexer > create mode 100755 debian/scripts/koha-start-indexer > create mode 100755 debian/scripts/koha-stop-indexer > >diff --git a/debian/koha-common.cron.d b/debian/koha-common.cron.d >index cd7f3c2..c7fc94e 100644 >--- a/debian/koha-common.cron.d >+++ b/debian/koha-common.cron.d >@@ -6,5 +6,5 @@ > SHELL=/bin/sh > PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > >-*/5 * * * * root test -x /usr/sbin/koha-rebuild-zebra && koha-rebuild-zebra $(koha-list --enabled) >+# */5 * * * * root test -x /usr/sbin/koha-rebuild-zebra && koha-rebuild-zebra $(koha-list --enabled) > */15 * * * * root koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/process_message_queue.pl >diff --git a/debian/koha-common.init b/debian/koha-common.init >index 5be77d3..7946785 100755 >--- a/debian/koha-common.init >+++ b/debian/koha-common.init >@@ -45,6 +45,7 @@ do_start() > # We insure all required directories exist, including disabled ones. > koha-create-dirs $(koha-list) > koha-start-zebra $(koha-list --enabled) >+ koha-start-indexer $(koha-list --enabled) > } > > # >@@ -54,6 +55,7 @@ do_stop() > { > # We stop everything, including disabled ones. > koha-stop-zebra $(koha-list) || true >+ koha-stop-indexer $(koha-list --enabled) > } > > # >@@ -61,6 +63,7 @@ do_stop() > # > do_reload() { > koha-restart-zebra $(koha-list --enabled) >+ koha-restart-indexer $(koha-list --enabled) > } > > case "$1" in >diff --git a/debian/scripts/koha-restart-indexer b/debian/scripts/koha-restart-indexer >new file mode 100755 >index 0000000..7030b92 >--- /dev/null >+++ b/debian/scripts/koha-restart-indexer >@@ -0,0 +1,50 @@ >+#!/bin/sh >+# >+# koha-restart-indexer -- Restart Indexer Daemon for named Koha instandes >+# Copyright 2012 Tomás Cohen Arazi @ Universidad Nacional de Córdoba >+# >+# This program is free software: you can redistribute it and/or modify >+# it under the terms of the GNU General Public License as published by >+# the Free Software Foundation, either version 3 of the License, or >+# (at your option) any later version. >+# >+# This program is distributed in the hope that it will be useful, >+# but WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with this program. If not, see <http://www.gnu.org/licenses/>. >+ >+set -e >+ >+. /lib/lsb/init-functions >+ >+INDEXDAEMON="koha-index-daemon" >+PERL5LIB="/usr/share/koha/lib" >+ >+for name in "$@" >+do >+ >+ KOHA_CONF="/etc/koha/sites/$name/koha-conf.xm" >+ >+ INDEXDAEMON_OPTS="--timeout 30 \ >+ --conf $KOHA_CONF \ >+ --directory /var/tmp/koha-indexer-daemon-$name" >+ >+ DAEMONOPTS="--name=$name-koha-indexer \ >+ --errlog=/var/log/koha/$name/koha-indexer-error.log \ >+ --stdout=/var/log/koha/$name/koha-indexer.log \ >+ --output=/var/log/koha/$name/koha-indexer-output.log \ >+ --verbose=1 --respawn --delay=30 \ >+ --user=$name-koha.$name-koha" >+ >+ log_daemon_msg "Restarting Koha indexing daemon for $name" >+ >+ if daemon $DAEMONOPTS --restart -- $INDEXDAEMON $INDEXDAEMON_OPTS; then >+ log_end_msg 0 >+ else >+ log_end_msg 1 >+ fi >+ >+done >diff --git a/debian/scripts/koha-start-indexer b/debian/scripts/koha-start-indexer >new file mode 100755 >index 0000000..7ab7a02 >--- /dev/null >+++ b/debian/scripts/koha-start-indexer >@@ -0,0 +1,50 @@ >+#!/bin/sh >+# >+# koha-start-indexer -- Start Indexer Daemon for named Koha instandes >+# Copyright 2012 Tomás Cohen Arazi @ Universidad Nacional de Córdoba >+# >+# This program is free software: you can redistribute it and/or modify >+# it under the terms of the GNU General Public License as published by >+# the Free Software Foundation, either version 3 of the License, or >+# (at your option) any later version. >+# >+# This program is distributed in the hope that it will be useful, >+# but WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with this program. If not, see <http://www.gnu.org/licenses/>. >+ >+set -e >+ >+. /lib/lsb/init-functions >+ >+INDEXDAEMON="koha-index-daemon" >+PERL5LIB="/usr/share/koha/lib" >+ >+for name in "$@" >+do >+ >+ KOHA_CONF="/etc/koha/sites/$name/koha-conf.xm" >+ >+ INDEXDAEMON_OPTS="--timeout 30 \ >+ --conf $KOHA_CONF \ >+ --directory /var/tmp/koha-indexer-daemon-$name" >+ >+ DAEMONOPTS="--name=$name-koha-indexer \ >+ --errlog=/var/log/koha/$name/koha-indexer-error.log \ >+ --stdout=/var/log/koha/$name/koha-indexer.log \ >+ --output=/var/log/koha/$name/koha-indexer-output.log \ >+ --verbose=1 --respawn --delay=30 \ >+ --user=$name-koha.$name-koha" >+ >+ log_daemon_msg "Starting Koha indexing daemon for $name" >+ >+ if daemon $DAEMONOPTS -- $INDEXDAEMON $INDEXDAEMON_OPTS; then >+ log_end_msg 0 >+ else >+ log_end_msg 1 >+ fi >+ >+done >diff --git a/debian/scripts/koha-stop-indexer b/debian/scripts/koha-stop-indexer >new file mode 100755 >index 0000000..accb967 >--- /dev/null >+++ b/debian/scripts/koha-stop-indexer >@@ -0,0 +1,50 @@ >+#!/bin/sh >+# >+# koha-stop-indexer -- Stop Indexer Daemon for named Koha instandes >+# Copyright 2012 Tomás Cohen Arazi @ Universidad Nacional de Córdoba >+# >+# This program is free software: you can redistribute it and/or modify >+# it under the terms of the GNU General Public License as published by >+# the Free Software Foundation, either version 3 of the License, or >+# (at your option) any later version. >+# >+# This program is distributed in the hope that it will be useful, >+# but WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with this program. If not, see <http://www.gnu.org/licenses/>. >+ >+set -e >+ >+. /lib/lsb/init-functions >+ >+INDEXDAEMON="koha-index-daemon" >+PERL5LIB="/usr/share/koha/lib" >+ >+for name in "$@" >+do >+ >+ KOHA_CONF="/etc/koha/sites/$name/koha-conf.xm" >+ >+ INDEXDAEMON_OPTS="--timeout 30 \ >+ --conf $KOHA_CONF \ >+ --directory /var/tmp/koha-indexer-daemon-$name" >+ >+ DAEMONOPTS="--name=$name-koha-indexer \ >+ --errlog=/var/log/koha/$name/koha-indexer-error.log \ >+ --stdout=/var/log/koha/$name/koha-indexer.log \ >+ --output=/var/log/koha/$name/koha-indexer-output.log \ >+ --verbose=1 --respawn --delay=30 \ >+ --user=$name-koha.$name-koha" >+ >+ log_daemon_msg "Stopping Koha indexing daemon for $name" >+ >+ if daemon $DAEMONOPTS --stop -- $INDEXDAEMON $INDEXDAEMON_OPTS; then >+ log_end_msg 0 >+ else >+ log_end_msg 1 >+ fi >+ >+done >-- >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 8773
:
12248
|
12285
|
12292
|
12293
|
12294
|
12654
|
13009
|
13031
|
13050
|
13089
|
18258
|
19794
|
19798
|
19800
|
19805
|
21704
|
22135
|
23928
|
29194
|
29575
|
29669