diff --git a/debian/koha-common.bash-completion b/debian/koha-common.bash-completion deleted file mode 100644 index 1ef82db67e..0000000000 --- a/debian/koha-common.bash-completion +++ /dev/null @@ -1,385 +0,0 @@ -#!/bin/bash -# -# koha-common.bash-completion script for koha-* commands -# -# This file is part of Koha. -# -# Copyright 2013 Universidad Nacional de Cordoba -# Tomas Cohen Arazi -# -# Koha 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. -# -# Koha 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 Koha; if not, see . - -_build_substract_switches() -{ - local substract - - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == -* ]]; then - substract="$substract -e ${COMP_WORDS[i]}" - fi - done - - echo "$substract" -} - -_build_substract_instances() -{ - local substract - - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - substract="$substract -e ${COMP_WORDS[i]}" - done - - echo "$substract" -} - -_koha_single_instance() -{ - local filter=$1 - - cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $( compgen -W "$(koha-list $filter)" $cur ) ) - else - COMPREPLY=() - fi - - return 0 -} - -_koha_list_cmd() -{ - local filter=$1 - - local cur substract instancelist - _get_comp_words_by_ref cur - - # Build a list of the already used words - substract=`_build_substract_instances` - - if [[ "$substract" != "" ]]; then - instancelist=$( koha-list $filter | grep -v -x $substract ) - else - instancelist=$( koha-list $filter ) - fi - - COMPREPLY=( $(compgen -W "$instancelist" -- $cur ) ) - return 0 -} - -_koha_email_disable() -{ - _koha_list_cmd "--email" - return 0 -} -complete -F _koha_email_disable koha-email-disable - -_koha_email_enable() -{ - _koha_list_cmd "--noemail" - return 0 -} -complete -F _koha_email_enable koha-email-enable - -_koha_sip_enabled_instances() -{ - _koha_list_cmd "--sip" - return 0 -} - -_koha_sip_disabled() -{ - _koha_list_cmd "--nosip" - return 0 -} - -_koha_disabled_instances() -{ - _koha_list_cmd "--disabled" - return 0 -} - -_koha_enabled_instances() -{ - _koha_list_cmd "--enabled" - return 0 -} - -# koha-enable autocompletes with disabled instances -complete -F _koha_disabled_instances koha-enable - -# koha-disable autocompletes with enabled instances -complete -F _koha_enabled_instances koha-disable - -# koha-mysql autocompletes with a single instance name -complete -F _koha_single_instance koha-mysql - -_koha_list() -{ - local cur opts substract - - COMPREPLY=() - _get_comp_words_by_ref cur - opts="--enabled --disabled --email --noemail --plack --noplack --sip --nosip --help -h --elasticsearch --noelasticsearch" - - # Build a list of the already used option switches - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == -* ]]; then - case ${COMP_WORDS[i]} in - --disabled) - substract="$substract -e --enabled"; ;; - --enabled) - substract="$substract -e --disabled"; ;; - --elasticsearch) - substract="$substract -e --noelasticsearch"; ;; - --noelasticsearch) - substract="$substract -e --elasticsearch"; ;; - --email) - substract="$substract -e --noemail"; ;; - --noemail) - substract="$substract -e --email"; ;; - --plack) - substract="$substract -e --noplack"; ;; - --noplack) - substract="$substract -e --plack"; ;; - --sip) - substract="$substract -e --nosip"; ;; - --nosip) - substract="$substract -e --sip"; ;; - --help) - substract="$substract -e -h"; ;; - -h) - substract="$substract -e --help"; ;; - esac - substract="$substract -e ${COMP_WORDS[i]}" - fi - done - - if [[ "$substract" != "" ]]; then - opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) - fi - - COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) - - return 0 -} -complete -F _koha_list koha-list - -_koha_plack_instances() -{ - _koha_list_cmd "--plack" - return 0 -} - -_koha_noplack_instances() -{ - _koha_list_cmd "--noplack" - return 0 -} - -_koha-plack() -{ - local cur opts substract - - COMPREPLY=() - _get_comp_words_by_ref cur - opts="--start --stop --restart --enable --disable --quiet -q --help -h" - - # Build a list of the already used option switches - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == -* ]]; then - case ${COMP_WORDS[i]} in - --start) _koha_plack_instances ; return 0 ;; - --stop) _koha_plack_instances ; return 0 ;; - --restart) _koha_plack_instances ; return 0 ;; - --enable) _koha_noplack_instances ; return 0 ;; - --disable) _koha_plack_instances ; return 0 ;; - --help) COMPREPLY=() ; return 0 ;; # no more completions - -h) COMPREPLY=() ; return 0 ;; # no more completions - --quiet) # filter the other quiet switches and go on - substract="$substract -e -q"; ;; - -q) # filter the other quiet switches and go on - substract="$substract -e --quiet"; ;; - esac - substract="$substract -e ${COMP_WORDS[i]}" - fi - done - - if [[ "$substract" != "" ]]; then - opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) - fi - - COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) - - return 0 -} -complete -F _koha-plack koha-plack - -_koha-indexer() -{ - local cur opts substract - - COMPREPLY=() - _get_comp_words_by_ref cur - opts="--start --stop --restart --quiet -q --help -h" - - # Build a list of the already used option switches - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == -* ]]; then - case ${COMP_WORDS[i]} in - --start) _koha_list_cmd ; return 0 ;; - --stop) _koha_list_cmd ; return 0 ;; - --restart) _koha_list_cmd ; return 0 ;; - --help) COMPREPLY=() ; return 0 ;; # no more completions - -h) COMPREPLY=() ; return 0 ;; # no more completions - --quiet) # filter the other quiet switches and go on - substract="$substract -e -q"; ;; - -q) # filter the other quiet switches and go on - substract="$substract -e --quiet"; ;; - esac - substract="$substract -e ${COMP_WORDS[i]}" - fi - done - - if [[ "$substract" != "" ]]; then - opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) - fi - - COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) - - return 0 -} -complete -F _koha-indexer koha-indexer -complete -F _koha-indexer koha-es-indexer - -_koha-zebra() -{ - local cur opts substract - - COMPREPLY=() - _get_comp_words_by_ref cur - opts="--start --stop --restart --status --quiet -q --help -h" - - # Build a list of the already used option switches - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == -* ]]; then - case ${COMP_WORDS[i]} in - --start) _koha_list_cmd ; return 0 ;; - --stop) _koha_list_cmd ; return 0 ;; - --restart) _koha_list_cmd ; return 0 ;; - --status) _koha_list_cmd ; return 0 ;; - --help) COMPREPLY=() ; return 0 ;; # no more completions - -h) COMPREPLY=() ; return 0 ;; # no more completions - --quiet) # filter the other quiet switches and go on - substract="$substract -e -q"; ;; - -q) # filter the other quiet switches and go on - substract="$substract -e --quiet"; ;; - esac - substract="$substract -e ${COMP_WORDS[i]}" - fi - done - - if [[ "$substract" != "" ]]; then - opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) - fi - - COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) - - return 0 -} -complete -F _koha-zebra koha-zebra - - -_koha-worker() -{ - local cur opts substract - - COMPREPLY=() - _get_comp_words_by_ref cur - opts="--start --stop --restart --status --quiet -q --help -h" - - # Build a list of the already used option switches - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == -* ]]; then - case ${COMP_WORDS[i]} in - --start) _koha_list_cmd ; return 0 ;; - --stop) _koha_list_cmd ; return 0 ;; - --restart) _koha_list_cmd ; return 0 ;; - --status) _koha_list_cmd ; return 0 ;; - --help) COMPREPLY=() ; return 0 ;; # no more completions - -h) COMPREPLY=() ; return 0 ;; # no more completions - --quiet) # filter the other quiet switches and go on - substract="$substract -e -q"; ;; - -q) # filter the other quiet switches and go on - substract="$substract -e --quiet"; ;; - esac - substract="$substract -e ${COMP_WORDS[i]}" - fi - done - - if [[ "$substract" != "" ]]; then - opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) - fi - - COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) - - return 0 -} -complete -F _koha-worker koha-worker - -_koha-sip() -{ - local cur opts substract - - COMPREPLY=() - _get_comp_words_by_ref cur - opts="--start --stop --restart --status --enable --verbose -v --help -h" - - # Build a list of the already used option switches - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == -* ]]; then - case ${COMP_WORDS[i]} in - --start) _koha_sip_enabled_instances ; return 0 ;; - --stop) _koha_sip_enabled_instances ; return 0 ;; - --restart) _koha_sip_enabled_instances ; return 0 ;; - --status) _koha_sip_enabled_instances ; return 0 ;; - --enable) _koha_sip_disabled ; return 0 ;; - --help) COMPREPLY=() ; return 0 ;; # no more completions - -h) COMPREPLY=() ; return 0 ;; # no more completions - --verbose) # filter the other quiet switches and go on - substract="$substract -e -q"; ;; - -v) # filter the other quiet switches and go on - substract="$substract -e --verbose"; ;; - esac - substract="$substract -e ${COMP_WORDS[i]}" - fi - done - - if [[ "$substract" != "" ]]; then - opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) - fi - - COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) - - return 0 -} -complete -F _koha-sip koha-sip - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff --git a/debian/koha-common.config b/debian/koha-common.config deleted file mode 100755 index e8933a6f4c..0000000000 --- a/debian/koha-common.config +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -# koha-common.config - ensures that debconf stuff is all handled properly -# -# Copyright 2011 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 - -. /usr/share/debconf/confmodule - -CONFIGFILE=/etc/koha/koha-common.conf - -if [ -e $CONFIGFILE ]; then - . $CONFIGFILE || true - # Put the current values into debconf - UPDATE="true" - if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "no" ] ; then - UPDATE="false" - fi - db_set koha-common/automatically-update-translations "$UPDATE" -else - # True is the default - db_set koha-common/automatically-update-translations true -fi - -if dpkg --compare-versions "$2" lt-nl 3.4 ; then - db_input high koha-common/3.2-3.4-upgrade-notice || true -fi - -db_input medium koha-common/automatically-update-translations || true - -# Determine if we should ask the user about upgrading - there's no point -# if this is a fresh install anyway. -if [ -e /usr/sbin/koha-list ]; then - RENAME_APACHE_FILES="no" - for vhost in $(koha-list); do - if [ -f "/etc/apache2/sites-available/$vhost" ] && \ - [ ! -f "/etc/apache2/sites-available/$vhost.conf" ]; then - RENAME_APACHE_FILES="yes" - break # at least one, trigger renaming - fi - done - if [ "$RENAME_APACHE_FILES" = "yes" ]; then - db_input high koha-common/rename-apache-vhost-files || true - fi -fi - -db_go || true - diff --git a/debian/koha-common.default b/debian/koha-common.default deleted file mode 100644 index bbe7524ab7..0000000000 --- a/debian/koha-common.default +++ /dev/null @@ -1,60 +0,0 @@ -## General koha-common default options file - -PERL5LIB="/usr/share/koha/lib" -KOHA_HOME="/usr/share/koha" - -## Background record indexing -# -# The following options control the use of an indexing daemon for -# Koha instances. -# -# More information can be found here: -# -# http://wiki.koha-community.org/wiki/PackagesIndexDaemon -# -# USE_INDEXER_DAEMON: "no" | "yes" -# -USE_INDEXER_DAEMON="yes" - -# Set an alternate indexer daemon. The default is to use the rebuild_zebra.pl -# in daemon mode. -# -# Example: ALTERNATE_INDEXER_DAEMON="koha-index-daemon" -# -# ALTERNATE_INDEXER_DAEMON="" - -# Lookup/indexing frecquency (in seconds) for the indexing daemon. -# -# The default value is 5 -# -INDEXER_TIMEOUT=5 - -# Parameters to be passed to the indexer daemon. Useful for alternate indexers. -# Defaults to INDEXER_PARAMS="-daemon -sleep $INDEXER_TIMEOUT" -# -# INDEXER_PARAMS="" - -# Elasticsearch default options. Specifying the command line options to -# koha-elasticsearch will override these - -# Should biblios be indexed by default? -ES_INDEX_BIBLIOS="yes" -# Should authorities be indexed by default? -ES_INDEX_AUTHORITIES="yes" -# How many records should be batched for committing to elasticsearch at one time. You -# might want to decrease this if you're having issues with memory. -# Equivalent to '--commit' -ES_COMMIT_SIZE=5000 -# Now many parallel processes to use for indexing. If you have CPU -# cores to spare, this might be worth increasing. -# Equivalent to '--processes' -ES_NUMBER_OF_PROCESSES=1 -# Should the output be verbose by default? -# Equivalent to '--verbose' -ES_VERBOSE="no" -# A string that's supplied as a "where" query that can limit the records being idexed. -# You probably don't want to use this by default expect in some sort of special case. -# Equivalent to '--where' -#ES_WHERE_QUERY_SQL="" - -## End of general koha-common default options diff --git a/debian/koha-common.dirs b/debian/koha-common.dirs deleted file mode 100644 index b98541d007..0000000000 --- a/debian/koha-common.dirs +++ /dev/null @@ -1,6 +0,0 @@ -etc/koha/sites -var/cache/koha -var/lib/koha -var/log/koha -var/lock/koha -var/spool/koha diff --git a/debian/koha-common.links b/debian/koha-common.links deleted file mode 100644 index f330f5b745..0000000000 --- a/debian/koha-common.links +++ /dev/null @@ -1,6 +0,0 @@ -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 -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/koha-common.logrotate b/debian/koha-common.logrotate deleted file mode 100644 index 1f083fe69a..0000000000 --- a/debian/koha-common.logrotate +++ /dev/null @@ -1,15 +0,0 @@ -# Rotate log files for all Koha instances. - -/var/log/koha/*/*.log { - rotate 5 - weekly - missingok - copytruncate - compress - delaycompress - notifempty - sharedscripts - postrotate - /etc/init.d/apache2 reload > /dev/null - endscript -} diff --git a/debian/koha-common.preinst b/debian/koha-common.preinst index 648a2e1632..b7ec5041d5 100644 --- a/debian/koha-common.preinst +++ b/debian/koha-common.preinst @@ -2,10 +2,6 @@ set -e -# Bug 14055 - remove the yui symlink if there's one in the way preventing upgrades -[ -h /usr/share/koha/opac/htdocs/opac-tmpl/lib/yui ] && rm /usr/share/koha/opac/htdocs/opac-tmpl/lib/yui - -# Bug 25485: remove the tiny_mce symlink if there's one in the way preventing upgrades -[ -h /usr/share/koha/intranet/htdocs/intranet-tmpl/lib/tiny_mce ] && rm /usr/share/koha/intranet/htdocs/intranet-tmpl/lib/tiny_mce +#DEBHELPER# exit 0 diff --git a/debian/koha-core.bash-completion b/debian/koha-core.bash-completion index b7e20d5b52..7a212855b6 100644 --- a/debian/koha-core.bash-completion +++ b/debian/koha-core.bash-completion @@ -261,6 +261,7 @@ _koha-indexer() return 0 } complete -F _koha-indexer koha-indexer +complete -F _koha-indexer koha-es-indexer _koha-zebra() { @@ -299,6 +300,44 @@ _koha-zebra() } complete -F _koha-zebra koha-zebra + +_koha-worker() +{ + local cur opts substract + + COMPREPLY=() + _get_comp_words_by_ref cur + opts="--start --stop --restart --status --quiet -q --help -h" + + # Build a list of the already used option switches + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[i]} == -* ]]; then + case ${COMP_WORDS[i]} in + --start) _koha_list_cmd ; return 0 ;; + --stop) _koha_list_cmd ; return 0 ;; + --restart) _koha_list_cmd ; return 0 ;; + --status) _koha_list_cmd ; return 0 ;; + --help) COMPREPLY=() ; return 0 ;; # no more completions + -h) COMPREPLY=() ; return 0 ;; # no more completions + --quiet) # filter the other quiet switches and go on + substract="$substract -e -q"; ;; + -q) # filter the other quiet switches and go on + substract="$substract -e --quiet"; ;; + esac + substract="$substract -e ${COMP_WORDS[i]}" + fi + done + + if [[ "$substract" != "" ]]; then + opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) + fi + + COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) + + return 0 +} +complete -F _koha-worker koha-worker + _koha-sip() { local cur opts substract diff --git a/debian/koha-common.cron.d b/debian/koha-core.cron.d similarity index 100% rename from debian/koha-common.cron.d rename to debian/koha-core.cron.d diff --git a/debian/koha-common.cron.daily b/debian/koha-core.cron.daily similarity index 100% rename from debian/koha-common.cron.daily rename to debian/koha-core.cron.daily diff --git a/debian/koha-common.cron.hourly b/debian/koha-core.cron.hourly similarity index 100% rename from debian/koha-common.cron.hourly rename to debian/koha-core.cron.hourly diff --git a/debian/koha-common.cron.monthly b/debian/koha-core.cron.monthly similarity index 100% rename from debian/koha-common.cron.monthly rename to debian/koha-core.cron.monthly diff --git a/debian/koha-core.default b/debian/koha-core.default index b0e0bc4cc9..6c108e4fe1 100644 --- a/debian/koha-core.default +++ b/debian/koha-core.default @@ -1,4 +1,4 @@ -## General koha-common default options file +## General koha-core default options file PERL5LIB="/usr/share/koha/lib" KOHA_HOME="/usr/share/koha" @@ -14,7 +14,7 @@ KOHA_HOME="/usr/share/koha" # # USE_INDEXER_DAEMON: "no" | "yes" # -USE_INDEXER_DAEMON="no" +USE_INDEXER_DAEMON="yes" # Set an alternate indexer daemon. The default is to use the rebuild_zebra.pl # in daemon mode. @@ -34,4 +34,27 @@ INDEXER_TIMEOUT=5 # # INDEXER_PARAMS="" -## End of general koha-common default options +# Elasticsearch default options. Specifying the command line options to +# koha-elasticsearch will override these + +# Should biblios be indexed by default? +ES_INDEX_BIBLIOS="yes" +# Should authorities be indexed by default? +ES_INDEX_AUTHORITIES="yes" +# How many records should be batched for committing to elasticsearch at one time. You +# might want to decrease this if you're having issues with memory. +# Equivalent to '--commit' +ES_COMMIT_SIZE=5000 +# Now many parallel processes to use for indexing. If you have CPU +# cores to spare, this might be worth increasing. +# Equivalent to '--processes' +ES_NUMBER_OF_PROCESSES=1 +# Should the output be verbose by default? +# Equivalent to '--verbose' +ES_VERBOSE="no" +# A string that's supplied as a "where" query that can limit the records being idexed. +# You probably don't want to use this by default expect in some sort of special case. +# Equivalent to '--where' +#ES_WHERE_QUERY_SQL="" + +## End of general koha-core default options diff --git a/debian/koha-core.init b/debian/koha-core.init deleted file mode 100755 index f86021d9cb..0000000000 --- a/debian/koha-core.init +++ /dev/null @@ -1,226 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: koha-core -# Required-Start: $remote_fs memcached -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start required services for each Koha instance -# Description: For each enabled Koha instance on this host, -# if enabled, start: -# - a Zebra server (using koha-zebra) -# - a Plack server (using koha-plack) -# - a SIP server (using koha-sip) -# - a Z3950 server (using koha-z3950-responder) -### END INIT INFO - -# Author: Lars Wirzenius - -# Do NOT "set -e" - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="Koha ILS" -NAME="koha-core" -SCRIPTNAME=/etc/init.d/$NAME - -# Exit if the package is not installed -[ -x /usr/sbin/koha-zebra ] || exit 0 - -# Read configuration variable file if it is present -if [ -r /etc/default/$NAME ]; then - # Debian / Ubuntu - . /etc/default/$NAME -elif [ -r /etc/sysconfig/$NAME ]; then - # RedHat / SuSE - . /etc/sysconfig/$NAME -fi - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -# 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 - -# -# Function that starts the daemon/service -# -do_start() -{ - # We insure all required directories exist, including disabled ones. - koha-create-dirs $(koha-list) -## koha-zebra --start $(koha-list --enabled) -## koha-sip --start $(koha-list --enabled --sip) -## koha-plack --start $(koha-list --enabled --plack) -## koha-z3950-responder --start --quiet $(koha-list --enabled --z3950) -## koha-worker --start $(koha-list --enabled) - - if [ "$USE_INDEXER_DAEMON" = "yes" ]; then - koha-indexer --start --quiet $(koha-list --enabled) - fi -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # We stop everything, including disabled ones. -## koha-zebra --stop $(koha-list) || true -## koha-sip --stop $(koha-list --sip) -## koha-plack --stop --quiet $(koha-list --enabled --plack) -## koha-z3950-responder --stop --quiet $(koha-list --enabled --z3950) -## koha-worker --stop --quiet $(koha-list --enabled) - - if [ "$USE_INDEXER_DAEMON" = "yes" ]; then - koha-indexer --stop --quiet $(koha-list --enabled) - fi -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { -## koha-zebra --restart $(koha-list --enabled) -## koha-sip --restart $(koha-list --enabled --sip) -## koha-plack --restart --quiet $(koha-list --enabled --plack) -## koha-z3950-responder --restart --quiet $(koha-list --enabled --z3950) -## koha-worker --restart --quiet $(koha-list --enabled) - - if [ "$USE_INDEXER_DAEMON" = "yes" ]; then - koha-indexer --restart --quiet $(koha-list --enabled) - fi -} - -# -# Function that shows the status of the zebrasrv daemon for -# enabled instances -# -zebra_status() -{ - for instance in $(koha-list --enabled); do - - log_daemon_msg "Zebra server running for instance $instance" - - if is_zebra_running $instance ; then - log_end_msg 0 - else - log_end_msg 1 - fi - done -} - -# -# Function that shows the status of the SIP server daemon for -# enabled instances -# -sip_status() -{ - for instance in $(koha-list --enabled --sip); do - - log_daemon_msg "SIP server running for instance $instance" - - if is_sip_running $instance ; then - log_end_msg 0 - else - log_end_msg 1 - fi - done -} - -# -# Function that shows the status of the Plack server daemon for -# enabled instances -# -plack_status() -{ - for instance in $(koha-list --enabled --plack); do - - log_daemon_msg "Plack server running for instance ${instance}" - - if is_plack_running $instance ; then - log_end_msg 0 - else - log_end_msg 1 - fi - done -} - -# -# Function that shows the status of the Z39.50/SRU server daemon for -# enabled instances -# -z3950_status() -{ - for instance in $(koha-list --enabled --z3950); do - - log_daemon_msg "Z39.50/SRU daemon running for instance ${instance}" - - if is_z3950_running $instance ; then - log_end_msg 0 - else - log_end_msg 1 - fi - done -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - *) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - *) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0) - do_start - case "$?" in - 0) log_end_msg 0 ;; - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - status) - zebra_status - sip_status - plack_status - z3950_status - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/koha-common.init b/debian/koha-sysv.init similarity index 100% rename from debian/koha-common.init rename to debian/koha-sysv.init diff --git a/debian/koha-sysv.install b/debian/koha-sysv.install index 4f89cde45d..3298ad35aa 100644 --- a/debian/koha-sysv.install +++ b/debian/koha-sysv.install @@ -1,2 +1,2 @@ -debian/koha-common.init etc/init.d/koha-common -debian/koha-common.service lib/systemd/system/ +debian/koha-sysv.init etc/init.d/koha-common +debian/koha-sysv.service lib/systemd/system/ diff --git a/debian/koha-common.service b/debian/koha-sysv.service similarity index 100% rename from debian/koha-common.service rename to debian/koha-sysv.service