From e1995e3e9cde14405fe72433955aca827a05567f Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 30 Jan 2019 15:31:43 -0300 Subject: [PATCH] Bug 22238: Remove koha-*-sip scripts in favor of koha-sip This patch removes traces from the (deprecated) koha-*-sip scripts. To test: - Apply the patch - Verify no traces of koha-*-sip remain on the codebase (besides Release Notes, koha-common.links and the koha-sip script): $ cd kohaclone $ git grep koha-start-sip $ git grep koha-stop-sip $ git grep koha-enable-sip => SUCCESS: No traces! - Create the following symlinks: $ sudo ln -s /usr/sbin/koha-sip /usr/sbin/koha-start-sip $ sudo ln -s /usr/sbin/koha-sip /usr/sbin/koha-stop-sip $ sudo ln -s /usr/sbin/koha-sip /usr/sbin/koha-enable-sip - Try the koha-*-zebra commands: $ sudo koha-stop-sip kohadev $ sudo koha-start-sip kohadev $ sudo koha-restart-sip kohadev => SUCCESS: They all work as expected! - Sign off :-D! Signed-off-by: Kyle M Hall --- debian/docs/koha-common.xml | 23 +--------- debian/docs/koha-enable-sip.xml | 57 ------------------------- debian/docs/koha-start-sip.xml | 53 ----------------------- debian/docs/koha-stop-sip.xml | 52 ----------------------- debian/koha-common.bash-completion | 8 ---- debian/koha-common.install | 5 +-- debian/koha-common.links | 5 ++- debian/scripts/koha-enable-sip | 38 ----------------- debian/scripts/koha-sip | 2 + debian/scripts/koha-start-sip | 68 ------------------------------ debian/scripts/koha-stop-sip | 45 -------------------- 11 files changed, 8 insertions(+), 348 deletions(-) delete mode 100644 debian/docs/koha-enable-sip.xml delete mode 100644 debian/docs/koha-start-sip.xml delete mode 100644 debian/docs/koha-stop-sip.xml delete mode 100755 debian/scripts/koha-enable-sip delete mode 100755 debian/scripts/koha-start-sip delete mode 100755 debian/scripts/koha-stop-sip diff --git a/debian/docs/koha-common.xml b/debian/docs/koha-common.xml index 492545b8e1..1bcf180396 100644 --- a/debian/docs/koha-common.xml +++ b/debian/docs/koha-common.xml @@ -4,7 +4,7 @@ Koha is the first free software library automation package. The Koha Community - http://koha-community.org/ + https://koha-community.org/ @@ -180,27 +180,6 @@ Manage the SIP server for named Koha instances. - - - - - Copies the SIP configuration file to allow SIP to be controlled by init scripts. - - - - - - - Starts the SIP daemon for the specified Koha instances. - - - - - - - Stops the SIP daemon for the specified Koha instances. - - diff --git a/debian/docs/koha-enable-sip.xml b/debian/docs/koha-enable-sip.xml deleted file mode 100644 index 3ce3b09b30..0000000000 --- a/debian/docs/koha-enable-sip.xml +++ /dev/null @@ -1,57 +0,0 @@ -
-koha-enable-sip - - Koha is the first free software library automation package. - - - Robin - Sheat - - - Catalyst IT - http://www.catalyst.net.nz - - Author - - - - - - - koha-enable-sip - 8 - - - - koha-enable-sip - Copies the SIP configuration file to allow SIP to be controlled by init scripts. - UNIX/Linux - - - - - koha-enable-sip - instancename - - - - Description - This copies the default SIP configuration file /etc/koha/SIPconfig.xml to the - /etc/koha/sites/instancename directory. This allows it to be started by - koha-start-sip(8), and koha-stop-sip. In turn, - this means that it will be started on boot and stopped on shutdown. - After running this, you will need to edit the newly created file to configure it - for your site. - To disable SIP again, delete or rename the configuration file. - - - See also - - koha-start-sip(8) - koha-stop-sip(8) - - - - - -
diff --git a/debian/docs/koha-start-sip.xml b/debian/docs/koha-start-sip.xml deleted file mode 100644 index b6a18dd848..0000000000 --- a/debian/docs/koha-start-sip.xml +++ /dev/null @@ -1,53 +0,0 @@ -
-koha-start-sip - - Koha is the first free software library automation package. - - - Robin - Sheat - - - Catalyst IT - http://www.catalyst.net.nz - - Author - - - - - - - koha-start-sip - 8 - - - - koha-start-sip - Starts the SIP daemon for the specified Koha instances. - UNIX/Linux - - - - - koha-start-sip - instancename - - - - Description - This will start the SIP daemon for the Koha instance specified by instancename. - If the SIP configuration is not present for the supplied instance, it will be silently skipped. - To enable SIP support for an instance, refer to koha-enable-sip(8). - - - See also - - koha-stop-sip(8) - koha-enable-sip(8) - - - - - -
diff --git a/debian/docs/koha-stop-sip.xml b/debian/docs/koha-stop-sip.xml deleted file mode 100644 index 3e5a1793fa..0000000000 --- a/debian/docs/koha-stop-sip.xml +++ /dev/null @@ -1,52 +0,0 @@ -
-koha-stop-sip - - Koha is the first free software library automation package. - - - Robin - Sheat - - - Catalyst IT - http://www.catalyst.net.nz - - Author - - - - - - - koha-stop-sip - 8 - - - - koha-stop-sip - Stops the SIP daemon for the specified Koha instances. - UNIX/Linux - - - - - koha-stop-sip - instancename - - - - Description - This will stop the SIP daemon for the Koha instance specified by instancename. - If it's not running, an note will be displayed. - - - See also - - koha-start-sip(8) - koha-enable-sip(8) - - - - - -
diff --git a/debian/koha-common.bash-completion b/debian/koha-common.bash-completion index 56b428d447..b40ae47a3a 100644 --- a/debian/koha-common.bash-completion +++ b/debian/koha-common.bash-completion @@ -98,20 +98,12 @@ _koha_sip_enabled_instances() return 0 } -# koha-*-sip autocomplete with sip-enabled instances -complete -F _koha_sip_enabled_instances koha-start-sip -complete -F _koha_sip_enabled_instances koha-restart-sip -complete -F _koha_sip_enabled_instances koha-stop-sip - _koha_sip_disabled() { _koha_list_cmd "--nosip" return 0 } -# koha-enable-sip autocompletes with sip-disabled instances -complete -F _koha_sip_disabled koha-enable-sip - _koha_disabled_instances() { _koha_list_cmd "--disabled" diff --git a/debian/koha-common.install b/debian/koha-common.install index 6c54fc28fa..f7068e0163 100644 --- a/debian/koha-common.install +++ b/debian/koha-common.install @@ -29,13 +29,10 @@ debian/scripts/koha-reset-passwd usr/sbin debian/scripts/koha-restore usr/sbin debian/scripts/koha-run-backups usr/sbin debian/scripts/koha-shell usr/sbin +debian/scripts/koha-sip usr/sbin debian/scripts/koha-sitemap usr/sbin debian/scripts/koha-translate usr/sbin debian/scripts/koha-upgrade-schema usr/sbin debian/scripts/koha-upgrade-to-3.4 usr/sbin debian/scripts/koha-zebra usr/sbin -debian/scripts/koha-start-sip usr/sbin -debian/scripts/koha-stop-sip usr/sbin -debian/scripts/koha-enable-sip usr/sbin -debian/scripts/koha-sip usr/sbin debian/tmp_docbook/*.8 usr/share/man/man8 diff --git a/debian/koha-common.links b/debian/koha-common.links index ff81a8d748..f330f5b745 100644 --- a/debian/koha-common.links +++ b/debian/koha-common.links @@ -1,3 +1,6 @@ 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 +usr/sbin/koha-zebra usr/sbin/koha-restart-zebra +usr/sbin/koha-sip usr/sbin/koha-enable-sip +usr/sbin/koha-sip usr/sbin/koha-start-sip +usr/sbin/koha-sip usr/sbin/koha-stop-sip diff --git a/debian/scripts/koha-enable-sip b/debian/scripts/koha-enable-sip deleted file mode 100755 index 1bcdd97571..0000000000 --- a/debian/scripts/koha-enable-sip +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# -# koha-enable-sip -- Set up the config files to allow SIP to run -# Copyright 2012 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 - -for name in "$@" -do - if [ ! -e /etc/koha/sites/${name}/koha-conf.xml ] ; - then - echo "No such instance: ${name}" > /dev/stderr - continue; - fi - sipfile=/etc/koha/sites/${name}/SIPconfig.xml - if [ -e ${sipfile} ] - then - echo "SIP already enabled for $name" - else - echo "Enabling SIP for $name - edit ${sipfile} to configure" - cp -v /etc/koha/SIPconfig.xml ${sipfile} - chown ${name}-koha:${name}-koha ${sipfile} - chmod 600 ${sipfile} - fi -done diff --git a/debian/scripts/koha-sip b/debian/scripts/koha-sip index da6909ba43..ef2611173d 100755 --- a/debian/scripts/koha-sip +++ b/debian/scripts/koha-sip @@ -229,6 +229,8 @@ if [ "$used_script_name" != "koha-sip" ]; then set_action "start" ;; koha-stop-sip) set_action "stop" ;; + koha-enable-sip) + set_action "enable" ;; *) break ;; esac diff --git a/debian/scripts/koha-start-sip b/debian/scripts/koha-start-sip deleted file mode 100755 index 7f4f8182bd..0000000000 --- a/debian/scripts/koha-start-sip +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# koha-start-sip -- Start SIP server for named Koha instance -# Copyright 2012 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 - -# 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 - -for name in "$@" -do - if [ ! -e /etc/koha/sites/${name}/koha-conf.xml ] ; - then - echo "No such instance: ${name}" > /dev/stderr - continue; - fi - [ -e /etc/koha/sites/${name}/SIPconfig.xml ] || continue - echo "Starting SIP server for $name" - mkdir -p /var/run/koha/${name} - chown "${name}-koha:${name}-koha" /var/run/koha/${name} - - adjust_paths_dev_install $name - export KOHA_CONF PERL5LIB - KOHA_CONF=/etc/koha/sites/${name}/koha-conf.xml - # PERL5LIB has been read already - if [ "$DEV_INSTALL" = "" ]; then - LIBDIR=$KOHA_HOME/lib - else - LIBDIR=$KOHA_HOME - fi - - daemon \ - --name="$name-koha-sip" \ - --errlog="/var/log/koha/$name/sip-error.log" \ - --stdout="/var/log/koha/$name/sip.log" \ - --output="/var/log/koha/$name/sip-output.log" \ - --verbose=1 \ - --respawn \ - --delay=30 \ - --pidfiles="/var/run/koha/${name}" \ - --user="$name-koha.$name-koha" \ - -- \ - perl \ - "$LIBDIR/C4/SIP/SIPServer.pm" \ - "/etc/koha/sites/${name}/SIPconfig.xml" -done diff --git a/debian/scripts/koha-stop-sip b/debian/scripts/koha-stop-sip deleted file mode 100755 index bfe7cd31c6..0000000000 --- a/debian/scripts/koha-stop-sip +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# -# koha-stop-sip -- Stop SIP server for named Koha instance -# Copyright 2012 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 - -for name in "$@" -do - if [ ! -e /etc/koha/sites/${name}/koha-conf.xml ] ; - then - echo "No such instance: ${name}" > /dev/stderr - continue; - fi - if [ ! -e /var/run/koha/${name}/${name}-koha-sip.pid ] ; - then - echo "SIP server for ${name} not running." - continue; - fi - echo "Stopping SIP server for $name" - daemon \ - --name="$name-koha-sip" \ - --errlog="/var/log/koha/$name/sip-error.log" \ - --stdout="/var/log/koha/$name/sip.log" \ - --output="/var/log/koha/$name/sip-output.log" \ - --verbose=1 \ - --respawn \ - --delay=30 \ - --pidfiles="/var/run/koha/${name}" \ - --user="$name-koha.$name-koha" \ - --stop -done -- 2.17.2 (Apple Git-113)