@@ -, +, @@
setup
---
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
--- a/debian/koha-common.cron.d
+++ a/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
--- a/debian/koha-common.init
+++ a/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
--- a/debian/scripts/koha-restart-indexer
+++ a/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 .
+
+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
--- a/debian/scripts/koha-start-indexer
+++ a/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 .
+
+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
--- a/debian/scripts/koha-stop-indexer
+++ a/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 .
+
+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
--