Bug 40901: (testing follow-up) Remove / rename koha-common to koha-core

This patch removes or renames some of the debian files from koha-common
to koha-core, to avoid file clash during install

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Jake Deery 2026-03-24 13:48:09 +00:00 committed by Pedro Amorim
parent a0f36621ad
commit 80e6ddaa90
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
17 changed files with 68 additions and 770 deletions

View File

@ -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 <https://www.gnu.org/licenses>.
_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

View File

@ -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 <https://www.gnu.org/licenses/>.
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

View File

@ -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

View File

@ -1,6 +0,0 @@
etc/koha/sites
var/cache/koha
var/lib/koha
var/log/koha
var/lock/koha
var/spool/koha

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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

226
debian/koha-core.init vendored
View File

@ -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 <lars@catalyst.net.nz>
# 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
:

View File

@ -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/