From c545e08186dc74448cad815d43d88f4ecfef276b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 1 Mar 2023 10:22:22 -0300 Subject: [PATCH] Bug 33108: koha-es-indexer added Signed-off-by: Nick Clemens --- debian/docs/koha-es-indexer.xml | 100 ++++++++++++ debian/koha-common.bash-completion | 1 + debian/koha-common.install | 1 + debian/koha-core.install | 1 + debian/scripts/koha-es-indexer | 247 +++++++++++++++++++++++++++++ debian/scripts/koha-functions.sh | 28 ++++ 6 files changed, 378 insertions(+) create mode 100644 debian/docs/koha-es-indexer.xml create mode 100755 debian/scripts/koha-es-indexer diff --git a/debian/docs/koha-es-indexer.xml b/debian/docs/koha-es-indexer.xml new file mode 100644 index 0000000000..abb407ade4 --- /dev/null +++ b/debian/docs/koha-es-indexer.xml @@ -0,0 +1,100 @@ +
+koha-es-indexer + +Koha is the first free software library automation package. + + The Koha Community + https://koha-community.org/ + + + + + + + koha-es-indexer + 8 + + + + koha-es-indexer + Manage the ES indexer daemon for Koha instances. + UNIX/Linux + + + + + koha-es-indexer + |||||||| + instancename + + + + Options + + + + + + + Start the ES indexer daemon for the desired Koha instances. + + + + + + + Stop the ES indexer daemon for the desired Koha instances. + + + + + + + Restart the ES indexer daemon for the desired Koha instances. + + + + + + + Specify the batch size to commit at a time (default: 10). + + + + + + + Show the status of the ES indexer for the specified instances. + + + + + + + Make the script quiet about non existent instance names. Useful when calling koha-es-indexer from another scripts. + + + + + + + Show usage information. + + + + + + + Description + The koha-es-indexer script lets you manage your Koha instances ES indexer daemon. + + + See also + + /etc/default/koha-common + + + + + +
diff --git a/debian/koha-common.bash-completion b/debian/koha-common.bash-completion index 94966d360e..aacb841ea6 100644 --- a/debian/koha-common.bash-completion +++ b/debian/koha-common.bash-completion @@ -257,6 +257,7 @@ _koha-indexer() return 0 } complete -F _koha-indexer koha-indexer +complete -F _koha-indexer koha-es-indexer _koha-zebra() { diff --git a/debian/koha-common.install b/debian/koha-common.install index 2f5c793d11..2b8c0f4646 100644 --- a/debian/koha-common.install +++ b/debian/koha-common.install @@ -16,6 +16,7 @@ debian/scripts/koha-elasticsearch usr/sbin debian/scripts/koha-email-disable usr/sbin debian/scripts/koha-email-enable usr/sbin debian/scripts/koha-enable usr/sbin +debian/scripts/koha-es-indexer usr/sbin debian/scripts/koha-foreach usr/sbin debian/scripts/koha-indexer usr/sbin debian/scripts/koha-list usr/sbin diff --git a/debian/koha-core.install b/debian/koha-core.install index 2f5c793d11..2b8c0f4646 100644 --- a/debian/koha-core.install +++ b/debian/koha-core.install @@ -16,6 +16,7 @@ debian/scripts/koha-elasticsearch usr/sbin debian/scripts/koha-email-disable usr/sbin debian/scripts/koha-email-enable usr/sbin debian/scripts/koha-enable usr/sbin +debian/scripts/koha-es-indexer usr/sbin debian/scripts/koha-foreach usr/sbin debian/scripts/koha-indexer usr/sbin debian/scripts/koha-list usr/sbin diff --git a/debian/scripts/koha-es-indexer b/debian/scripts/koha-es-indexer new file mode 100755 index 0000000000..29d78f9664 --- /dev/null +++ b/debian/scripts/koha-es-indexer @@ -0,0 +1,247 @@ +#!/bin/bash +# +# Copyright 2023 Koha Development team +# +# 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 + +# Read configuration variable file if it is present +[ -r /etc/default/koha-common ] && . /etc/default/koha-common + +# 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 + +usage() +{ + local scriptname=$(basename $0) + + cat < /dev/null") + + if [ "$search_engine" = "Elasticsearch" ]; then + return 0 + else + return 1 + fi +} + adjust_paths_dev_install() { # Adjust KOHA_HOME, PERL5LIB for dev installs, as indicated by -- 2.30.2