From 55ec3ffde295aedd27291ab1770d982926c2ec78 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 19 Oct 2016 16:21:33 -0300 Subject: [PATCH] Bug 17468: Remove koha-*-zebra scripts and its traces --- debian/docs/koha-common.xml | 18 +----- debian/docs/koha-rebuild-zebra.xml | 4 +- debian/docs/koha-restart-zebra.xml | 44 -------------- debian/docs/koha-start-zebra.xml | 44 -------------- debian/docs/koha-stop-zebra.xml | 44 -------------- debian/koha-common.bash-completion | 5 -- debian/koha-common.init | 13 ++--- debian/koha-common.install | 3 - debian/koha-common.logrotate | 4 +- debian/scripts/koha-create | 2 +- debian/scripts/koha-disable | 2 +- debian/scripts/koha-remove | 2 +- debian/scripts/koha-restart-zebra | 116 ------------------------------------- debian/scripts/koha-start-zebra | 89 ---------------------------- debian/scripts/koha-stop-zebra | 74 ----------------------- 15 files changed, 14 insertions(+), 450 deletions(-) delete mode 100644 debian/docs/koha-restart-zebra.xml delete mode 100644 debian/docs/koha-start-zebra.xml delete mode 100644 debian/docs/koha-stop-zebra.xml delete mode 100755 debian/scripts/koha-restart-zebra delete mode 100755 debian/scripts/koha-start-zebra delete mode 100755 debian/scripts/koha-stop-zebra diff --git a/debian/docs/koha-common.xml b/debian/docs/koha-common.xml index 2790341..7d00a9b 100644 --- a/debian/docs/koha-common.xml +++ b/debian/docs/koha-common.xml @@ -119,16 +119,9 @@ - + - Start Zebra for named Koha instances. - - - - - - - Restart Zebra for named Koha instances. + Handle Zebra for named Koha instances. @@ -140,13 +133,6 @@ - - - Stop Zebra for named Koha instances. - - - - Manage the indexer daemon for named Koha instances. diff --git a/debian/docs/koha-rebuild-zebra.xml b/debian/docs/koha-rebuild-zebra.xml index 099c045..81e1364 100644 --- a/debian/docs/koha-rebuild-zebra.xml +++ b/debian/docs/koha-rebuild-zebra.xml @@ -86,9 +86,7 @@ See also - koha-restart-zebra(8) - koha-start-zebra(8) - koha-stop-zebra(8) + koha-zebra(8) diff --git a/debian/docs/koha-restart-zebra.xml b/debian/docs/koha-restart-zebra.xml deleted file mode 100644 index 4b78902..0000000 --- a/debian/docs/koha-restart-zebra.xml +++ /dev/null @@ -1,44 +0,0 @@ -
-koha-restart-zebra - -Koha is the first free software library automation package. - - The Koha Community - http://koha-community.org/ - - - - - - - koha-restart-zebra - 8 - - - - koha-restart-zebra - Restart Zebra for named Koha instances. - UNIX/Linux - - - - - koha-restart-zebra instancename - - - - Description - Restart Zebra for named Koha instances. - - - See also - - koha-rebuild-zebra(8) - koha-start-zebra(8) - koha-stop-zebra(8) - - - - - -
diff --git a/debian/docs/koha-start-zebra.xml b/debian/docs/koha-start-zebra.xml deleted file mode 100644 index 2d52000..0000000 --- a/debian/docs/koha-start-zebra.xml +++ /dev/null @@ -1,44 +0,0 @@ -
-koha-start-zebra - -Koha is the first free software library automation package. - - The Koha Community - http://koha-community.org/ - - - - - - - koha-start-zebra - 8 - - - - koha-start-zebra - Start Zebra for named Koha instances. - UNIX/Linux - - - - - koha-start-zebra instancename - - - - Description - Start Zebra for named Koha instances. - - - See also - - koha-rebuild-zebra(8) - koha-restart-zebra(8) - koha-stop-zebra(8) - - - - - -
diff --git a/debian/docs/koha-stop-zebra.xml b/debian/docs/koha-stop-zebra.xml deleted file mode 100644 index ea35f89..0000000 --- a/debian/docs/koha-stop-zebra.xml +++ /dev/null @@ -1,44 +0,0 @@ -
-koha-stop-zebra - -Koha is the first free software library automation package. - - The Koha Community - http://koha-community.org/ - - - - - - - koha-stop-zebra - 8 - - - - koha-stop-zebra - Stop Zebra for named Koha instances. - UNIX/Linux - - - - - koha-stop-zebra instancename - - - - Description - Stop Zebra for named Koha instances. - - - See also - - koha-rebuild-zebra(8) - koha-restart-zebra(8) - koha-start-zebra(8) - - - - - -
diff --git a/debian/koha-common.bash-completion b/debian/koha-common.bash-completion index cb2f3a4..276cba0 100644 --- a/debian/koha-common.bash-completion +++ b/debian/koha-common.bash-completion @@ -130,11 +130,6 @@ complete -F _koha_disabled_instances koha-enable # koha-disable autocompletes with enabled instances complete -F _koha_enabled_instances koha-disable -# koha-*-zebra autocomplete with enabled instances -complete -F _koha_enabled_instances koha-start-zebra -complete -F _koha_enabled_instances koha-restart-zebra -complete -F _koha_enabled_instances koha-stop-zebra - # koha-mysql autocompletes with a single instance name complete -F _koha_single_instance koha-mysql diff --git a/debian/koha-common.init b/debian/koha-common.init index b461056..5b169ad 100755 --- a/debian/koha-common.init +++ b/debian/koha-common.init @@ -5,10 +5,9 @@ # Required-Stop: $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: Start Zebra server for each Koha instance +# Short-Description: Start required services for each Koha instance # Description: For each enabled Koha instance on this host, -# as listed by "koha-list --enabled", start a Zebra -# server (using koha-start-zebra). +# start the required services (Zebra, SIP, Indexer and Plack) ### END INIT INFO # Author: Lars Wirzenius @@ -22,7 +21,7 @@ NAME="koha-common" SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed -[ -x /usr/sbin/koha-start-zebra ] || exit 0 +[ -x /usr/sbin/koha-zebra ] || exit 0 # Read configuration variable file if it is present if [ -r /etc/default/$NAME ]; then @@ -55,7 +54,7 @@ do_start() { # We insure all required directories exist, including disabled ones. koha-create-dirs $(koha-list) - koha-start-zebra $(koha-list --enabled) + koha-zebra --start $(koha-list --enabled) koha-start-sip $(koha-list --enabled) koha-plack --start $(koha-list --enabled --plack) @@ -70,7 +69,7 @@ do_start() do_stop() { # We stop everything, including disabled ones. - koha-stop-zebra $(koha-list) || true + koha-zebra --stop $(koha-list) || true koha-stop-sip $(koha-list) || true koha-plack --stop --quiet $(koha-list --enabled --plack) @@ -83,7 +82,7 @@ do_stop() # Function that sends a SIGHUP to the daemon/service # do_reload() { - koha-restart-zebra $(koha-list --enabled) + koha-zebra --restart $(koha-list --enabled) koha-stop-sip $(koha-list) || true koha-start-sip $(koha-list --enabled) koha-plack --restart --quiet $(koha-list --enabled --plack) diff --git a/debian/koha-common.install b/debian/koha-common.install index 27ecdd2..32b4686 100644 --- a/debian/koha-common.install +++ b/debian/koha-common.install @@ -25,13 +25,10 @@ debian/scripts/koha-plack usr/sbin debian/scripts/koha-rebuild-zebra usr/sbin debian/scripts/koha-remove usr/sbin debian/scripts/koha-reset-passwd usr/sbin -debian/scripts/koha-restart-zebra usr/sbin debian/scripts/koha-restore usr/sbin debian/scripts/koha-run-backups usr/sbin debian/scripts/koha-shell usr/sbin debian/scripts/koha-sitemap usr/sbin -debian/scripts/koha-start-zebra usr/sbin -debian/scripts/koha-stop-zebra usr/sbin debian/scripts/koha-translate usr/sbin debian/scripts/koha-upgrade-schema usr/sbin debian/scripts/koha-upgrade-to-3.4 usr/sbin diff --git a/debian/koha-common.logrotate b/debian/koha-common.logrotate index 5b6663a..3d8f7c0 100644 --- a/debian/koha-common.logrotate +++ b/debian/koha-common.logrotate @@ -9,12 +9,12 @@ notifempty sharedscripts prerotate - /usr/sbin/koha-stop-zebra $(koha-list --enabled) > /dev/null + /usr/sbin/koha-zebra --stop $(koha-list --enabled) > /dev/null /usr/sbin/koha-plack --stop --quiet $(koha-list --enabled --plack) > /dev/null endscript postrotate /etc/init.d/apache2 reload > /dev/null /usr/sbin/koha-plack --start --quiet $(koha-list --enabled --plack) > /dev/null - /usr/sbin/koha-start-zebra $(koha-list --enabled) > /dev/null + /usr/sbin/koha-zebra --start $(koha-list --enabled) > /dev/null endscript } diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index e416c8c..d479347 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -784,7 +784,7 @@ then service apache2 restart # Start Zebra. - koha-start-zebra "$name" + koha-zebra --start "$name" if [ "$USE_INDEXER_DAEMON" = "yes" ]; then # Start Indexer daemon diff --git a/debian/scripts/koha-disable b/debian/scripts/koha-disable index 2e2e67a..e9169f1 100755 --- a/debian/scripts/koha-disable +++ b/debian/scripts/koha-disable @@ -67,7 +67,7 @@ do koha-stop-sip $name fi if is_zebra_running $name; then - koha-stop-zebra $name + koha-zebra --stop $name fi if is_indexer_running $name; then koha-indexer --stop $name diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove index 4342c5d..b9a0404 100755 --- a/debian/scripts/koha-remove +++ b/debian/scripts/koha-remove @@ -77,7 +77,7 @@ eof fi #` # If the daemon is not running already, we don't want to fail this loop. So bin the result code if this fails. - koha-stop-zebra $name || /bin/true + koha-zebra --stop $name || /bin/true instancefile=$(get_apache_config_for $name) le_opacdomain=$(letsencrypt_get_opacdomain_for $name) diff --git a/debian/scripts/koha-restart-zebra b/debian/scripts/koha-restart-zebra deleted file mode 100755 index b978b5e..0000000 --- a/debian/scripts/koha-restart-zebra +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# -# koha-restart-zebra - Restart Zebra for named Koha instances -# Copyright 2010 Catalyst IT, Ltd -# -# 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 - -# 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 - -restart_zebra_instance() -{ - local instancename=$1 - - if is_zebra_running $instancename; then - echo "Restarting Zebra server for $instancename" - daemon \ - --name="$instancename-koha-zebra" \ - --pidfiles="/var/run/koha/$instancename/" \ - --errlog="/var/log/koha/$instancename/zebra-error.log" \ - --stdout="/var/log/koha/$instancename/zebra.log" \ - --output="/var/log/koha/$instancename/zebra-output.log" \ - --verbose=1 \ - --respawn \ - --delay=30 \ - --user="$instancename-koha.$instancename-koha" \ - --restart \ - -- \ - zebrasrv \ - -v none,fatal,warn \ - -f "/etc/koha/sites/$instancename/koha-conf.xml" && \ - return 0 - else - return 1 - fi -} - -start_zebra_instance() -{ - local instancename=$1 - - if is_enabled $instancename; then - echo "Starting Zebra server for $instancename" - daemon \ - --name="$instancename-koha-zebra" \ - --pidfiles="/var/run/koha/$instancename/" \ - --errlog="/var/log/koha/$instancename/zebra-error.log" \ - --stdout="/var/log/koha/$instancename/zebra.log" \ - --output="/var/log/koha/$instancename/zebra-output.log" \ - --verbose=1 \ - --respawn \ - --delay=30 \ - --user="$instancename-koha.$instancename-koha" \ - -- \ - zebrasrv \ - -v none,fatal,warn \ - -f "/etc/koha/sites/$instancename/koha-conf.xml" && \ - return 0 - else - return 1 - fi -} - -usage() -{ - local scriptname=$0 - cat <. - -set -e - -# 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 - -start_zebra_instance() -{ - local instancename=$1 - - # get zebra log levels from koha-conf.xml - local loglevels=$(get_loglevels $instancename) - - echo "Starting Zebra server for $instancename" - touch "/var/log/koha/$instancename/zebra-error.log" \ - "/var/log/koha/$instancename/zebra-output.log" - chown "$instancename-koha:$instancename-koha" \ - "/var/log/koha/$instancename/zebra-error.log" \ - "/var/log/koha/$instancename/zebra-output.log" - daemon \ - --name="$instancename-koha-zebra" \ - --pidfiles="/var/run/koha/$instancename/" \ - --errlog="/var/log/koha/$instancename/zebra-error.log" \ - --output="/var/log/koha/$instancename/zebra-output.log" \ - --verbose=1 \ - --respawn \ - --delay=30 \ - --user="$instancename-koha.$instancename-koha" \ - -- \ - zebrasrv \ - -v $loglevels \ - -f "/etc/koha/sites/$instancename/koha-conf.xml" && \ - return 0 || \ - return 1 -} - -usage() -{ - local scriptname=$0 - cat <. - -set -e - -# 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 - -stop_zebra_instance() -{ - local instancename=$1 - - local PIDFILE="/var/run/koha/${instancename}/${instancename}-koha-zebra.pid" - echo "Stopping Zebra server for $instancename" - - if start-stop-daemon --pidfile ${PIDFILE} --stop --quiet --retry=TERM/30/KILL/5; then - return 0; - else - return 1; - fi - -} - -usage() -{ - local scriptname=$0 - cat <