aboutsummaryrefslogtreecommitdiff
path: root/libeufin/root/etc/rc.d
diff options
context:
space:
mode:
Diffstat (limited to 'libeufin/root/etc/rc.d')
-rw-r--r--libeufin/root/etc/rc.d/rc.libeufin.new50
1 files changed, 50 insertions, 0 deletions
diff --git a/libeufin/root/etc/rc.d/rc.libeufin.new b/libeufin/root/etc/rc.d/rc.libeufin.new
new file mode 100644
index 0000000..42e9c3e
--- /dev/null
+++ b/libeufin/root/etc/rc.d/rc.libeufin.new
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# Startup/shutdown script for GNU Taler's libeufin bank.
+#
+
+export USERPROFILE=/var/lib/libeufin
+
+create_run_dir() {
+ if [ ! -d /run/libeufin-bank/ ]; then
+ mkdir -p /run/libeufin-bank
+ chown libeufin-bank:libeufin-bank /run/libeufin-bank
+ chmod g+wX /run/libeufin-bank
+ fi
+}
+
+start() {
+ echo "Starting Libeufin Bank"
+ create_run_dir
+
+ daemon \
+ --name=libeufin-bank \
+ --user=libeufin-bank \
+ --pidfiles=/run/libeufin-bank \
+ --output=/var/log/taler/libeufin-bank.log \
+ -- libeufin-bank serve --config /etc/libeufin/libeufin-bank.conf
+}
+
+stop() {
+ echo "Stopping Libeufin Bank"
+ /usr/bin/daemon --name=libeufin-bank --pidfiles=/run/libeufin-bank --stop
+}
+
+status() {
+ /usr/bin/daemon --name=libeufin-bank --pidfiles=/run/libeufin-bank --running --verbose
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+status)
+ status
+ ;;
+*)
+ echo "Usage: $0 {start|stop|status}"
+ exit 1
+esac