Bugzilla – Attachment 71885 Details for
Bug 17468
Remove koha-*-zebra scripts in favor of koha-zebra
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Backwards compatible] Bug 17468: Remove koha-*-zebra scripts and its traces
Backwards-compatible-Bug-17468-Remove-koha--zebra-.patch (text/plain), 18.56 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-02-17 15:33:16 UTC
(
hide
)
Description:
[Backwards compatible] Bug 17468: Remove koha-*-zebra scripts and its traces
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-02-17 15:33:16 UTC
Size:
18.56 KB
patch
obsolete
>From 03909d1310f3974a235ef6b5ae598cc0c92f3b54 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Sat, 17 Feb 2018 12:20:09 -0300 >Subject: [PATCH] [Backwards compatible] 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 >--- > 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 @@ > <variablelist> > > <varlistentry> >- <term><option>koha-start-zebra</option></term> >+ <term><option>koha-zebra</option></term> > <listitem> >- <para>Start Zebra for named Koha instances.</para> >- </listitem> >- </varlistentry> >- >- <varlistentry> >- <term><option>koha-restart-zebra</option></term> >- <listitem> >- <para>Restart Zebra for named Koha instances.</para> >+ <para>Manage the Zebra daemon for named Koha instances.</para> > </listitem> > </varlistentry> > >@@ -139,13 +132,6 @@ > </listitem> > </varlistentry> > >- <varlistentry> >- <term><option>koha-stop-zebra</option></term> >- <listitem> >- <para>Stop Zebra for named Koha instances.</para> >- </listitem> >- </varlistentry> >- > <varlistentry> > <term><option>koha-indexer</option></term> > <listitem> >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 @@ > > <refsect1><title>See also</title> > <simplelist type="inline"> >- <member><command>koha-restart-zebra(8)</command></member> >- <member><command>koha-start-zebra(8)</command></member> >- <member><command>koha-stop-zebra(8)</command></member> >+ <member><command>koha-zebra(8)</command></member> > </simplelist> > </refsect1> > >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 @@ >-<article xmlns='http://docbook.org/ns/docbook'> >-<title>koha-restart-zebra</title> >-<info> >-<productname>Koha</productname> is the first free software library automation package. >-<author> >- <orgname>The Koha Community</orgname> >- <uri>http://koha-community.org/</uri> >-</author> >-</info> >- >-<refentry xml:id="koha-restart-zebra"> >- >- <refmeta> >- <refentrytitle>koha-restart-zebra</refentrytitle> >- <manvolnum>8</manvolnum> >- </refmeta> >- >- <refnamediv> >- <refname>koha-restart-zebra</refname> >- <refpurpose>Restart Zebra for named Koha instances.</refpurpose> >- <refclass>UNIX/Linux</refclass> >- </refnamediv> >- >- <refsynopsisdiv> >- <cmdsynopsis> >- <command>koha-restart-zebra</command> <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg> >- </cmdsynopsis> >- </refsynopsisdiv> >- >- <refsect1><title>Description</title> >- <para>Restart Zebra for named Koha instances.</para> >- </refsect1> >- >- <refsect1><title>See also</title> >- <simplelist type="inline"> >- <member><command>koha-rebuild-zebra(8)</command></member> >- <member><command>koha-start-zebra(8)</command></member> >- <member><command>koha-stop-zebra(8)</command></member> >- </simplelist> >- </refsect1> >- >-</refentry> >- >-</article> >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 @@ >-<article xmlns='http://docbook.org/ns/docbook'> >-<title>koha-start-zebra</title> >-<info> >-<productname>Koha</productname> is the first free software library automation package. >-<author> >- <orgname>The Koha Community</orgname> >- <uri>http://koha-community.org/</uri> >-</author> >-</info> >- >-<refentry xml:id="koha-start-zebra"> >- >- <refmeta> >- <refentrytitle>koha-start-zebra</refentrytitle> >- <manvolnum>8</manvolnum> >- </refmeta> >- >- <refnamediv> >- <refname>koha-start-zebra</refname> >- <refpurpose>Start Zebra for named Koha instances.</refpurpose> >- <refclass>UNIX/Linux</refclass> >- </refnamediv> >- >- <refsynopsisdiv> >- <cmdsynopsis> >- <command>koha-start-zebra</command> <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg> >- </cmdsynopsis> >- </refsynopsisdiv> >- >- <refsect1><title>Description</title> >- <para>Start Zebra for named Koha instances.</para> >- </refsect1> >- >- <refsect1><title>See also</title> >- <simplelist type="inline"> >- <member><command>koha-rebuild-zebra(8)</command></member> >- <member><command>koha-restart-zebra(8)</command></member> >- <member><command>koha-stop-zebra(8)</command></member> >- </simplelist> >- </refsect1> >- >-</refentry> >- >-</article> >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 @@ >-<article xmlns='http://docbook.org/ns/docbook'> >-<title>koha-stop-zebra</title> >-<info> >-<productname>Koha</productname> is the first free software library automation package. >-<author> >- <orgname>The Koha Community</orgname> >- <uri>http://koha-community.org/</uri> >-</author> >-</info> >- >-<refentry xml:id="koha-stop-zebra"> >- >- <refmeta> >- <refentrytitle>koha-stop-zebra</refentrytitle> >- <manvolnum>8</manvolnum> >- </refmeta> >- >- <refnamediv> >- <refname>koha-stop-zebra</refname> >- <refpurpose>Stop Zebra for named Koha instances.</refpurpose> >- <refclass>UNIX/Linux</refclass> >- </refnamediv> >- >- <refsynopsisdiv> >- <cmdsynopsis> >- <command>koha-stop-zebra</command> <arg choice="req" rep="repeat"><replaceable>instancename</replaceable></arg> >- </cmdsynopsis> >- </refsynopsisdiv> >- >- <refsect1><title>Description</title> >- <para>Stop Zebra for named Koha instances.</para> >- </refsect1> >- >- <refsect1><title>See also</title> >- <simplelist type="inline"> >- <member><command>koha-rebuild-zebra(8)</command></member> >- <member><command>koha-restart-zebra(8)</command></member> >- <member><command>koha-start-zebra(8)</command></member> >- </simplelist> >- </refsect1> >- >-</refentry> >- >-</article> >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 <http://www.gnu.org/licenses/>. >- >-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 <<EOF >-Restart Zebra for Koha instances. >- >-Usage: $scriptname instancename1 instancename2... >- >-EOF >-} >- >-# Parse command line. >-#[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) >- >-# Loop through the instance names >-for name in "$@" >-do >- if is_instance $name ; then >- if ! is_zebra_running $name; then >- warn "Zebra does not appear to have been running for instance $name." >- >- if ! start_zebra_instance $name ; then >- warn "Something went wrong starting Zebra for $name." >- fi >- else >- if ! restart_zebra_instance $name; then >- warn "Something went wrong restarting Zebra for $name." >- fi >- fi >- else >- warn "Unknown instance $name." >- fi >-done >- >-exit 0 >diff --git a/debian/scripts/koha-start-zebra b/debian/scripts/koha-start-zebra >deleted file mode 100755 >index 513547efe5..0000000000 >--- a/debian/scripts/koha-start-zebra >+++ /dev/null >@@ -1,89 +0,0 @@ >-#!/bin/sh >-# >-# koha-start-zebra - Start 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 <http://www.gnu.org/licenses/>. >- >-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 <<EOF >-Starts Zebra for Koha instances. >- >-Usage: $scriptname instancename1 instancename2... >- >-EOF >-} >- >-# Parse command line. >-#[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) >- >-# Loop through the instance names >-for name in "$@" >-do >- if is_instance $name ; then >- if ! is_zebra_running $name; then >- if ! start_zebra_instance $name; then >- warn "Something went wrong starting Zebra for $name." >- fi >- else >- warn "Zebra already running for instance $name." >- fi >- else >- warn "Unknown instance $name." >- fi >-done >- >-exit 0 >diff --git a/debian/scripts/koha-stop-zebra b/debian/scripts/koha-stop-zebra >deleted file mode 100755 >index 3e8660b0c1..0000000000 >--- a/debian/scripts/koha-stop-zebra >+++ /dev/null >@@ -1,74 +0,0 @@ >-#!/bin/sh >-# >-# koha-stop-zebra - Stop 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 <http://www.gnu.org/licenses/>. >- >-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 <<EOF >-Stops Zebra for Koha instances. >- >-Usage: $scriptname instancename1 instancename2... >- >-EOF >-} >- >-# Parse command line. >-#[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) >- >-# Loop through the instance names >-for name in "$@" >-do >- if is_instance $name ; then >- if is_zebra_running $name; then >- if ! stop_zebra_instance $name; then >- warn "Something went wrong stopping Zebra for $name." >- fi >- else >- warn "Zebra already stopped for instance $name." >- fi >- else >- warn "Unknown instance $name." >- fi >-done >- >-exit 0 >-- >2.16.2
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 17468
:
56672
|
56673
|
56702
|
56703
|
71885
|
71886
|
72492