aboutsummaryrefslogtreecommitdiff
path: root/taler-merchant/root/etc/rc.d/rc.taler-merchant.new
blob: cf6c783dd52821b8df3e815822245811bf748553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/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() {
  echo "Starting Taler Merchant"
  create_run_dir

  daemon \
    --name=taler-merchant-httpd \
    --user=taler-merchant \
    --pidfiles=/run/taler \
    --output=/var/log/taler/taler-merchant-httpd.log \
    -- taler-merchant-httpd --config /etc/taler/taler.conf
}

stop() {
  echo "Stopping Taler Merchant"
  /usr/bin/daemon --name=taler-merchant-httpd --pidfiles=/run/taler --stop
}

status() {
  /usr/bin/daemon --name=taler-merchant-httpd --pidfiles=/run/taler --running --verbose
}

case "$1" in
start)
  start
  ;;
stop)
  stop
  ;;
status)
  status
  ;;
*)
  echo "Usage: $0 {start|stop|status}"
  exit 1
esac