aboutsummaryrefslogtreecommitdiff
path: root/taler-exchange/root/etc/rc.d/rc.taler-exchange.new
blob: b0328305be0a0366f7a0b241dc8e83d0f45e4831 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
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