@@ -, +, @@
- koha-start-sip
- koha-stop-sip
- koha-enable-sip
- Apply this patch
- Run:
$ misc4dev/cp_debian_files.pl
$ sudo koha-sip --enable kohadev
$ sudo koha-sip --start kohadev
$ sudo koha-sip --status kohadev
- Run:
$ sudo koha-sip --restart --verbose kohadev
$ sudo koha-sip --status kohadev
- Run:
$ sudo koha-sip --stop kohadev
$ sudo koha-sip --status kohadev
- Play with other combinations like enabling an already enabled
- Sign off :-D
---
debian/koha-common.install | 1 +
debian/scripts/koha-functions.sh | 14 ++
debian/scripts/koha-sip | 308 +++++++++++++++++++++++++++++++
3 files changed, 323 insertions(+)
create mode 100755 debian/scripts/koha-sip
--- a/debian/koha-common.install
+++ a/debian/koha-common.install
@@ -37,4 +37,5 @@ 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
--- a/debian/scripts/koha-functions.sh
+++ a/debian/scripts/koha-functions.sh
@@ -157,6 +157,20 @@ is_sitemap_enabled()
fi
}
+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
+}
+
is_zebra_running()
{
local instancename=$1
--- a/debian/scripts/koha-sip
+++ a/debian/scripts/koha-sip
@@ -0,0 +1,308 @@
+#!/bin/bash
+
+# koha-sip - Manage SIP server for Koha instances
+# Copyright 2019 Theke Solutions
+# 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
+
+. /lib/lsb/init-functions
+
+# 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
+
+usage()
+{
+ local scriptname=$(basename $0)
+
+ cat <