# 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
#
koha-create-dirs $(koha-list)
koha-start-zebra $(koha-list --enabled)
koha-start-sip $(koha-list --enabled)
+ koha-plack --start $(koha-list --enabled --plack)
if [ "$USE_INDEXER_DAEMON" = "yes" ]; then
koha-indexer --start --quiet $(koha-list --enabled)
# We stop everything, including disabled ones.
koha-stop-zebra $(koha-list) || true
koha-stop-sip $(koha-list) || true
+ koha-plack --stop --quiet $(koha-list --enabled --plack)
if [ "$USE_INDEXER_DAEMON" = "yes" ]; then
koha-indexer --stop --quiet $(koha-list --enabled)
koha-restart-zebra $(koha-list --enabled)
koha-stop-sip $(koha-list) || true
koha-start-sip $(koha-list --enabled)
+ koha-plack --restart --quiet $(koha-list --enabled --plack)
if [ "$USE_INDEXER_DAEMON" = "yes" ]; then
koha-indexer --restart --quiet $(koha-list --enabled)
fi
}
-#
-# Function that checks zebrasrv is running for the specified instance
-#
-is_zebra_running()
-{
- local instancename=$1
-
- if daemon --name="$instancename-koha-zebra" \
- --user="$instancename-koha.$instancename-koha" \
- --running ; then
- return 0
- else
- return 1
- fi
-}
-
-#
-# Function that checks SIP server is running for the specified instance
-#
-is_sip_running()
-{
- local instancename=$1
-
- if daemon --name="$instancename-koha-sip" \
- --pidfiles="/var/run/koha/$instancename" \
- --user="$instancename-koha.$instancename-koha" \
- --running ; then
- return 0
- else
- return 1
- fi
-}
-
#
# Function that shows the status of the zebrasrv daemon for
# enabled instances
{
for instance in $(koha-list --enabled); do
- log_daemon_msg "Zebra server running for instace $instance"
+ log_daemon_msg "Zebra server running for instance $instance"
if is_zebra_running $instance ; then
log_end_msg 0
{
for instance in $(koha-list --enabled --sip); do
- log_daemon_msg "SIP server running for instace $instance"
+ log_daemon_msg "SIP server running for instance $instance"
if is_sip_running $instance ; then
log_end_msg 0
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
+}
+
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
status)
zebra_status
sip_status
+ plack_status
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2