diff options
Diffstat (limited to 'taler-exchange/root/etc/rc.d/rc.taler-exchange.new')
-rwxr-xr-x | taler-exchange/root/etc/rc.d/rc.taler-exchange.new | 305 |
1 files changed, 305 insertions, 0 deletions
diff --git a/taler-exchange/root/etc/rc.d/rc.taler-exchange.new b/taler-exchange/root/etc/rc.d/rc.taler-exchange.new new file mode 100755 index 0000000..b032830 --- /dev/null +++ b/taler-exchange/root/etc/rc.d/rc.taler-exchange.new @@ -0,0 +1,305 @@ +#!/bin/sh +# +# Startup/shutdown script for GNU Taler's exchange. +# + +create_run_dir() { + if [ ! -d /run/taler/ ]; then + mkdir -p /run/taler + chown :taler /run/taler + chmod g+wX /run/taler + fi +} + +start_httpd() { + echo "Starting Taler Exchange's httpd service" + create_run_dir + + daemon \ + --name=taler-exchange-httpd \ + --user=taler-exchange-httpd \ + --pidfiles=/run/taler \ + --output=/var/log/taler/taler-exchange-httpd.log \ + -- taler-exchange-httpd --config /etc/taler/taler.conf +} + +status_httpd() { + /usr/bin/daemon --name=taler-exchange-httpd --pidfiles=/run/taler --running --verbose +} + +stop_httpd() { + echo "Stopping Taler Exchange's httpd service" + /usr/bin/daemon --name=taler-exchange-httpd --pidfiles=/run/taler --stop +} + +start_aggregator() { + echo "Starting Taler Exchange's aggregator service" + create_run_dir + + daemon \ + --name=taler-exchange-aggregator \ + --user=taler-exchange-aggregator \ + --pidfiles=/run/taler \ + --output=/var/log/taler/taler-exchange-aggregator.log \ + -- taler-exchange-aggregator --config /etc/taler/taler.conf +} + +status_aggregator() { + /usr/bin/daemon --name=taler-exchange-aggregator --pidfiles=/run/taler --running --verbose +} + +stop_aggregator() { + echo "Stopping Taler Exchange's aggregator service" + /usr/bin/daemon --name=taler-exchange-aggregator --pidfiles=/run/taler --stop +} + +start_closer() { + echo "Starting Taler Exchange's closer service" + create_run_dir + + daemon \ + --name=taler-exchange-closer \ + --user=taler-exchange-closer \ + --pidfiles=/run/taler \ + --output=/var/log/taler/taler-exchange-closer.log \ + -- taler-exchange-closer --config /etc/taler/taler.conf +} + +status_closer() { + /usr/bin/daemon --name=taler-exchange-closer --pidfiles=/run/taler --running --verbose +} + +stop_closer() { + echo "Stopping Taler Exchange's closer service" + /usr/bin/daemon --name=taler-exchange-closer --pidfiles=/run/taler --stop +} + +start_secmod_cs() { + echo "Starting Taler Exchange's secmod-cs service" + create_run_dir + + daemon \ + --name=taler-exchange-secmod-cs \ + --user=taler-exchange-secmod-cs \ + --pidfiles=/run/taler \ + --output=/var/log/taler/taler-exchange-secmod-cs.log \ + -- taler-exchange-secmod-cs --config /etc/taler/taler.conf +} + +status_secmod_cs() { + /usr/bin/daemon --name=taler-exchange-secmod-cs --pidfiles=/run/taler --running --verbose +} + +stop_secmod_cs() { + echo "Stopping Taler Exchange's secmod-cs service" + /usr/bin/daemon --name=taler-exchange-secmod-cs --pidfiles=/run/taler --stop +} + +start_secmod_rsa() { + echo "Starting Taler Exchange's secmod-rsa service" + create_run_dir + + daemon \ + --name=taler-exchange-secmod-rsa \ + --user=taler-exchange-secmod-rsa \ + --pidfiles=/run/taler \ + --output=/var/log/taler/taler-exchange-secmod-rsa.log \ + -- taler-exchange-secmod-rsa --config /etc/taler/taler.conf +} + +status_secmod_rsa() { + /usr/bin/daemon --name=taler-exchange-secmod-rsa --pidfiles=/run/taler --running --verbose +} + +stop_secmod_rsa() { + echo "Stopping Taler Exchange's secmod-rsa service" + /usr/bin/daemon --name=taler-exchange-secmod-rsa --pidfiles=/run/taler --stop +} + +start_secmod_eddsa() { + echo "Starting Taler Exchange's secmod-eddsa service" + create_run_dir + + daemon \ + --name=taler-exchange-secmod-eddsa \ + --user=taler-exchange-secmod-eddsa \ + --pidfiles=/run/taler \ + --output=/var/log/taler/taler-exchange-secmod-eddsa.log \ + -- taler-exchange-secmod-eddsa --config /etc/taler/taler.conf +} + +stop_secmod_eddsa() { + echo "Stopping Taler Exchange's secmod-eddsa service" + /usr/bin/daemon --name=taler-exchange-secmod-eddsa --pidfiles=/run/taler --stop +} + +start_transfer() { + echo "Starting Taler Exchange's transfer service" + create_run_dir + + daemon \ + --name=taler-exchange-transfer \ + --user=taler-exchange-transfer \ + --pidfiles=/run/taler \ + --output=/var/log/taler/taler-exchange-transfer.log \ + -- taler-exchange-transfer --config /etc/taler/taler.conf +} + +status_transfer() { + /usr/bin/daemon --name=taler-exchange-transfer --pidfiles=/run/taler --running --verbose +} + +stop_transfer() { + echo "Stopping Taler Exchange's transfer service" + /usr/bin/daemon --name=taler-exchange-transfer --pidfiles=/run/taler --stop +} + +start_wirewatch() { + echo "Starting Taler Exchange's wirewatch service" + create_run_dir + + daemon \ + --name=taler-exchange-wirewatch \ + --user=taler-exchange-wirewatch \ + --pidfiles=/run/taler \ + --output=/var/log/taler/taler-exchange-wirewatch.log \ + -- taler-exchange-wirewatch --config /etc/taler/taler.conf +} + +status_wirewatch() { + /usr/bin/daemon --name=taler-exchange-wirewatch --pidfiles=/run/taler --running --verbose +} + +stop_wirewatch() { + echo "Stopping Taler Exchange's wirewatch service" + /usr/bin/daemon --name=taler-exchange-wirewatch --pidfiles=/run/taler --stop +} + +start() { + start_httpd + start_aggregator + start_closer + start_secmod_cs + start_secmod_rsa + start_secmod_eddsa + start_transfer + start_wirewatch +} + +status() { + status_httpd + status_aggregator + status_closer + status_secmod_cs + status_secmod_rsa + status_transfer + status_wirewatch +} + +stop() { + stop_httpd + stop_aggregator + stop_closer + stop_secmod_cs + stop_secmod_rsa + stop_transfer + stop_wirewatch +} + +case "$1" in +start-httpd) + start_httpd + ;; +status-httpd) + status_httpd + ;; +stop-httpd) + stop_httpd + ;; + +start-aggregator) + start_aggregator + ;; +status-aggregator) + status_aggregator + ;; +stop-aggregator) + stop_aggregator + ;; + +start-closer) + start_closer + ;; +status-closer) + status_closer + ;; +stop-closer) + stop_closer + ;; + +start-secmod_cs) + start_secmod_cs + ;; +status-secmod_cs) + status_secmod_cs + ;; +stop-secmod_cs) + stop_secmod_cs + ;; + +start-secmod_rsa) + start_secmod_rsa + ;; +status-secmod_rsa) + status_secmod_rsa + ;; +stop-secmod_rsa) + stop_secmod_rsa + ;; + +start-secmod_eddsa) + start_secmod_eddsa + ;; +status-secmod_eddsa) + status_secmod_eddsa + ;; +stop-secmod_eddsa) + stop_secmod_eddsa + ;; + +start-transfer) + start_transfer + ;; +status-transfer) + status_transfer + ;; +stop-transfer) + stop_transfer + ;; + +start-wirewatch) + start_wirewatch + ;; +status-wirewatch) + status_wirewatch + ;; +stop-wirewatch) + stop_wirewatch + ;; + +start) + start + ;; +status) + status + ;; +stop) + stop + ;; +*) + echo "Usage: $0 {start\(-*\)|stop\(-*\)|status\(-*\)}" + exit 1 +esac + + + |