From 385c16174b4156f59518cdd1de02ee81ba3c03b8 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Sat, 17 Feb 2018 12:20:09 -0300 Subject: [PATCH] Bug 17468: Remove koha-*-zebra scripts and its traces This patch removes traces from the (deprecated) koha-*-zebra scripts. To test: - Apply the patch - Verify no traces of koha-*-zebra remain on the codebase (besides Release Notes and the koha-zebra script): $ cd kohaclone $ git grep koha-start-zebra $ git grep koha-stop-zebra $ git grep koha-restart-zebra => SUCCESS: No traces! - Create the following symlinks: $ sudo ln -s /usr/sbin/koha-zebra /usr/sbin/koha-start-zebra $ sudo ln -s /usr/sbin/koha-zebra /usr/sbin/koha-stop-zebra $ sudo ln -s /usr/sbin/koha-zebra /usr/sbin/koha-restart-zebra - Try the koha-*-zebra commands: $ sudo koha-stop-zebra kohadev $ sudo koha-start-zebra kohadev $ sudo koha-restart-zebra kohadev => SUCCESS: They all work as expected! - Sign off :-D! Sponsored-by: Orex Digital Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart --- 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.install | 3 - debian/koha-common.links | 3 + debian/scripts/koha-restart-zebra | 116 ----------------------------- debian/scripts/koha-start-zebra | 89 ---------------------- debian/scripts/koha-stop-zebra | 74 ------------------ 11 files changed, 6 insertions(+), 438 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 create mode 100644 debian/koha-common.links 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 f14f750b1a..96a9cf4b8c 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. + Manage the Zebra daemon for named Koha instances. @@ -139,13 +132,6 @@ - - - - Stop Zebra for named Koha instances. - - - diff --git a/debian/docs/koha-rebuild-zebra.xml b/debian/docs/koha-rebuild-zebra.xml index 099c04557f..81e1364fbb 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 4b78902247..0000000000 --- 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 2d52000f9b..0000000000 --- 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 ea35f893ef..0000000000 --- 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 cb2f3a47ce..276cba07c9 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.install b/debian/koha-common.install index 259138d09d..f31bfdef8e 100644 --- a/debian/koha-common.install +++ b/debian/koha-common.install @@ -26,13 +26,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.links b/debian/koha-common.links new file mode 100644 index 0000000000..ff81a8d748 --- /dev/null +++ b/debian/koha-common.links @@ -0,0 +1,3 @@ +usr/sbin/koha-zebra usr/sbin/koha-start-zebra +usr/sbin/koha-zebra usr/sbin/koha-stop-zebra +usr/sbin/koha-zebra usr/sbin/koha-restart-zebra \ No newline at end of file diff --git a/debian/scripts/koha-restart-zebra b/debian/scripts/koha-restart-zebra deleted file mode 100755 index b978b5e0de..0000000000 --- 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 <