exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit b32093b3c1ee89aaaf87c5e9b17ea6da69b7ec0b
parent 4896dff5cd8afbc201b2f79ef04c11e85ce0304b
Author: Florian Dold <dold@taler.net>
Date:   Tue,  8 Sep 2026 00:46:10 +0200

services: apply DD102 restart and socket policy

Diffstat:
Mcontrib/packages/fedora/taler-auditor.taler-auditor-httpd.service | 8++++++--
Mcontrib/packages/fedora/taler-exchange.taler-exchange-aggregator.service | 9++++++---
Mcontrib/packages/fedora/taler-exchange.taler-exchange-aggregator@.service | 7+++++--
Mcontrib/packages/fedora/taler-exchange.taler-exchange-closer.service | 9++++++---
Mcontrib/packages/fedora/taler-exchange.taler-exchange-expire.service | 9++++++---
Mcontrib/packages/fedora/taler-exchange.taler-exchange-httpd.service | 20++++++++------------
Acontrib/packages/fedora/taler-exchange.taler-exchange-httpd.socket | 14++++++++++++++
Mcontrib/packages/fedora/taler-exchange.taler-exchange-httpd@.service | 19++++++++++---------
Acontrib/packages/fedora/taler-exchange.taler-exchange-httpd@.socket | 14++++++++++++++
Mcontrib/packages/fedora/taler-exchange.taler-exchange-secmod-cs.service | 7+++++--
Mcontrib/packages/fedora/taler-exchange.taler-exchange-secmod-eddsa.service | 8+++++---
Mcontrib/packages/fedora/taler-exchange.taler-exchange-secmod-rsa.service | 7+++++--
Mcontrib/packages/fedora/taler-exchange.taler-exchange-transfer.service | 9++++++---
Mcontrib/packages/fedora/taler-exchange.taler-exchange-wirewatch.service | 9++++++---
Mcontrib/packages/fedora/taler-exchange.taler-exchange-wirewatch@.service | 7+++++--
Acontrib/packages/fedora/taler-exchange.taler-exchange.target | 17+++++++++++++++++
Mdebian/rules | 2+-
Mdebian/taler-auditor.taler-auditor-httpd.service | 17++++++-----------
Mdebian/taler-auditor.taler-auditor-httpd.socket | 2+-
Mdebian/taler-auditor.taler-auditor.target | 3++-
Mdebian/taler-auditor.taler-helper-auditor-aggregation.service | 49++++++++++++++++++++++---------------------------
Mdebian/taler-auditor.taler-helper-auditor-aml.service | 50++++++++++++++++++++++----------------------------
Mdebian/taler-auditor.taler-helper-auditor-coins.service | 50++++++++++++++++++++++----------------------------
Mdebian/taler-auditor.taler-helper-auditor-deposits.service | 50++++++++++++++++++++++----------------------------
Mdebian/taler-auditor.taler-helper-auditor-purses.service | 51+++++++++++++++++++++++----------------------------
Mdebian/taler-auditor.taler-helper-auditor-reserves.service | 50++++++++++++++++++++++----------------------------
Mdebian/taler-auditor.taler-helper-auditor-transfer.service | 50++++++++++++++++++++++----------------------------
Mdebian/taler-auditor.taler-helper-auditor-wire-credit.service | 50++++++++++++++++++++++----------------------------
Mdebian/taler-auditor.taler-helper-auditor-wire-debit.service | 50++++++++++++++++++++++----------------------------
Mdebian/taler-exchange.taler-exchange-aggregator.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-aggregator@.service | 10++++++----
Mdebian/taler-exchange.taler-exchange-closer.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-dbinit-gc.service | 2+-
Mdebian/taler-exchange.taler-exchange-expire.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-httpd.service | 18++++++------------
Mdebian/taler-exchange.taler-exchange-httpd.socket | 2+-
Mdebian/taler-exchange.taler-exchange-httpd@.service | 14+++++++-------
Mdebian/taler-exchange.taler-exchange-httpd@.socket | 2+-
Mdebian/taler-exchange.taler-exchange-sanctionscheck.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-secmod-cs.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-secmod-eddsa.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-secmod-rsa.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-transfer.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-wirewatch.service | 8+++++---
Mdebian/taler-exchange.taler-exchange-wirewatch@.service | 10++++++----
Mdebian/taler-exchange.taler-exchange.target | 6+++++-
Msrc/auditor/report-lib.c | 27++++++++++++++-------------
Msrc/auditor/report-lib.h | 5+++--
Msrc/auditor/taler-auditor-httpd.c | 32++++++++++++++++----------------
Msrc/auditor/taler-helper-auditor-aggregation.c | 7+++----
Msrc/auditor/taler-helper-auditor-aml.c | 7+++----
Msrc/auditor/taler-helper-auditor-coins.c | 6+++---
Msrc/auditor/taler-helper-auditor-deposits.c | 7+++----
Msrc/auditor/taler-helper-auditor-purses.c | 7+++----
Msrc/auditor/taler-helper-auditor-reserves.c | 7+++----
Msrc/auditor/taler-helper-auditor-transfer.c | 7+++----
Msrc/auditor/taler-helper-auditor-wire-credit.c | 7+++----
Msrc/auditor/taler-helper-auditor-wire-debit.c | 7+++----
Msrc/exchange/taler-exchange-aggregator.c | 28++++++++++++++--------------
Msrc/exchange/taler-exchange-closer.c | 23++++++++++++-----------
Msrc/exchange/taler-exchange-expire.c | 15++++++++-------
Msrc/exchange/taler-exchange-httpd.c | 70+++++++++++++++++++++++++++++++++++-----------------------------------
Msrc/exchange/taler-exchange-httpd_get-keys.c | 13+++++++------
Msrc/exchange/taler-exchange-httpd_get-keys.h | 5+++--
Msrc/exchange/taler-exchange-sanctionscheck.c | 2+-
Msrc/exchange/taler-exchange-transfer.c | 21+++++++++++----------
Msrc/exchange/taler-exchange-wirewatch.c | 24++++++++++++------------
Msrc/util/taler-exchange-secmod-cs.c | 2+-
Msrc/util/taler-exchange-secmod-eddsa.c | 2+-
Msrc/util/taler-exchange-secmod-rsa.c | 2+-
70 files changed, 577 insertions(+), 539 deletions(-)

diff --git a/contrib/packages/fedora/taler-auditor.taler-auditor-httpd.service b/contrib/packages/fedora/taler-auditor.taler-auditor-httpd.service @@ -1,11 +1,15 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system auditor REST API -After=postgres.service network.target +After=postgresql.service network.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-auditor-httpd Type=simple -Restart=on-failure ExecStart=/usr/bin/taler-auditor-httpd -c /etc/taler/taler.conf [Install] diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-aggregator.service b/contrib/packages/fedora/taler-exchange.taler-exchange-aggregator.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange aggregator service PartOf=taler-exchange.target -After=postgres.service +After=postgresql.service [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-aggregator Type=simple -Restart=always -RestartSec=1s ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-aggregator@.service b/contrib/packages/fedora/taler-exchange.taler-exchange-aggregator@.service @@ -1,12 +1,15 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange aggregator service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-aggregator Type=simple -Restart=always -RestartSec=1s ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-closer.service b/contrib/packages/fedora/taler-exchange.taler-exchange-closer.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange closer service PartOf=taler-exchange.target -After=network.target postgres.service +After=network.target postgresql.service [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-closer Type=simple -Restart=always -RestartSec=1s ExecStart=/usr/bin/taler-exchange-closer -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-expire.service b/contrib/packages/fedora/taler-exchange.taler-exchange-expire.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange expire service PartOf=taler-exchange.target -After=postgres.service +After=postgresql.service [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-expire Type=simple -Restart=always -RestartSec=1s ExecStart=/usr/bin/taler-exchange-expire -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-httpd.service b/contrib/packages/fedora/taler-exchange.taler-exchange-httpd.service @@ -1,25 +1,21 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange REST API AssertPathExists=/run/taler/exchange-httpd -Requires=taler-exchange-httpd.socket taler-exchange-secmod-cs.service taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service -After=postgres.service network.target taler-exchange-secmod-cs.service taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service +Requires=taler-exchange-httpd.socket +After=postgresql.service network.target taler-exchange-secmod-cs.service taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartMode=direct +RestartPreventExitStatus=6 9 User=taler-exchange-httpd Type=simple -# Depending on the configuration, the service process kills itself and then -# needs to be restarted. Thus no significant delay on restarts. -Restart=always -RestartSec=1ms -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler/taler.conf StandardOutput=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-httpd.socket b/contrib/packages/fedora/taler-exchange.taler-exchange-httpd.socket @@ -0,0 +1,14 @@ +[Unit] +BindsTo=taler-exchange-httpd.service +Description=Taler Exchange Socket + +[Socket] +ListenStream=/run/taler/exchange-httpd/exchange-http.sock +Accept=no +Service=taler-exchange-httpd.service +SocketUser=taler-exchange-httpd +SocketGroup=apache +SocketMode=0660 + +[Install] +WantedBy=sockets.target diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-httpd@.service b/contrib/packages/fedora/taler-exchange.taler-exchange-httpd@.service @@ -1,19 +1,20 @@ -% This is a systemd service template. +# This is a systemd service template. [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange REST API at %I -AssertPathExists=/run/taler-exchange/httpd -Requires=taler-exchange-httpd@%i.socket taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service -After=postgres.service network.target taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service +AssertPathExists=/run/taler/exchange-httpd +Requires=taler-exchange-httpd@%i.socket +After=postgresql.service network.target taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartMode=direct +RestartPreventExitStatus=6 9 User=taler-exchange-httpd Type=simple -# Depending on the configuration, the service suicides and then -# needs to be restarted. -Restart=always -# Do not dally on restarts. -RestartSec=1ms EnvironmentFile=/etc/environment ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler/taler.conf StandardOutput=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-httpd@.socket b/contrib/packages/fedora/taler-exchange.taler-exchange-httpd@.socket @@ -0,0 +1,14 @@ +[Unit] +BindsTo=taler-exchange-httpd@%i.service +Description=Taler Exchange Socket at %I + +[Socket] +ListenStream=80 +Accept=no +Service=taler-exchange-httpd@%i.service +SocketUser=taler-exchange-httpd +SocketGroup=apache +SocketMode=0660 + +[Install] +WantedBy=sockets.target diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-secmod-cs.service b/contrib/packages/fedora/taler-exchange.taler-exchange-secmod-cs.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange CS security module AssertPathExists=/run/taler/exchange-secmod-cs PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-secmod-cs Type=simple -Restart=always -RestartSec=100ms ExecStart=/usr/bin/taler-exchange-secmod-cs -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-secmod-eddsa.service b/contrib/packages/fedora/taler-exchange.taler-exchange-secmod-eddsa.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange EdDSA security module AssertPathExists=/run/taler/exchange-secmod-eddsa PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-secmod-eddsa Type=simple -Restart=always -RestartSec=100ms ExecStart=/usr/bin/taler-exchange-secmod-eddsa -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal @@ -16,4 +19,3 @@ PrivateDevices=yes ProtectSystem=full IPAddressDeny=any Slice=taler-exchange.slice - diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-secmod-rsa.service b/contrib/packages/fedora/taler-exchange.taler-exchange-secmod-rsa.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange RSA security module AssertPathExists=/run/taler/exchange-secmod-rsa PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-secmod-rsa Type=simple -Restart=always -RestartSec=100ms ExecStart=/usr/bin/taler-exchange-secmod-rsa -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-transfer.service b/contrib/packages/fedora/taler-exchange.taler-exchange-transfer.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=Taler Exchange Transfer Service -After=network.target postgres.service +After=network.target postgresql.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-wire Type=simple -Restart=always -RestartSec=1s ExecStart=/usr/bin/taler-exchange-transfer -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-wirewatch.service b/contrib/packages/fedora/taler-exchange.taler-exchange-wirewatch.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange wirewatch service -After=network.target postgres.service +After=network.target postgresql.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-wire Type=simple -Restart=always -RestartSec=1s RuntimeMaxSec=3600s ExecStart=/usr/bin/taler-exchange-wirewatch -c /etc/taler/taler.conf StandardOutput=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange-wirewatch@.service b/contrib/packages/fedora/taler-exchange.taler-exchange-wirewatch@.service @@ -1,13 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange wirewatch service After=network.target PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartPreventExitStatus=6 9 User=taler-exchange-wire Type=simple -Restart=always -RestartSec=1s ExecStart=/usr/bin/taler-exchange-wirewatch -c /etc/taler/taler.conf StandardOutput=journal StandardError=journal diff --git a/contrib/packages/fedora/taler-exchange.taler-exchange.target b/contrib/packages/fedora/taler-exchange.taler-exchange.target @@ -0,0 +1,17 @@ +[Unit] +Wants=taler-exchange-secmod-cs.service +Wants=taler-exchange-secmod-rsa.service +Wants=taler-exchange-secmod-eddsa.service +Wants=postgresql.service +Description=GNU Taler exchange +After=postgresql.service network.target + +Wants=taler-exchange-httpd.service +Wants=taler-exchange-wirewatch.service +Wants=taler-exchange-aggregator.service +Wants=taler-exchange-closer.service +Wants=taler-exchange-expire.service +Wants=taler-exchange-transfer.service + +[Install] +WantedBy=multi-user.target diff --git a/debian/rules b/debian/rules @@ -56,7 +56,7 @@ override_dh_installsystemd: dh_installsystemd -ptaler-exchange-offline --name=taler-exchange-offline --no-start --no-enable --no-stop-on-upgrade dh_installsystemd -ptaler-exchange-offline --name=taler-exchange-offline.timer --no-start --no-enable --no-stop-on-upgrade # final invocation to generate daemon reload - dh_installsystemd + dh_installsystemd --no-start --no-enable --no-stop-on-upgrade override_dh_install: dh_install diff --git a/debian/taler-auditor.taler-auditor-httpd.service b/debian/taler-auditor.taler-auditor-httpd.service @@ -1,26 +1,21 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system auditor REST API AssertPathExists=/run/taler-auditor/httpd Requires=taler-auditor-httpd.socket -After=postgres.service network.target +After=postgresql.service network.target PartOf=taler-auditor.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-auditor-httpd Type=simple -Restart=always RestartMode=direct -RestartSec=10ms -RestartSteps=5 -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s ExecStart=/usr/bin/taler-auditor-httpd -c /etc/taler-auditor/taler-auditor.conf -L INFO StandardOutput=journal diff --git a/debian/taler-auditor.taler-auditor-httpd.socket b/debian/taler-auditor.taler-auditor-httpd.socket @@ -1,6 +1,6 @@ [Unit] +BindsTo=taler-auditor-httpd.service Description=Taler Auditor Socket -PartOf=taler-auditor-httpd.service [Socket] ListenStream=/run/taler-auditor/httpd/auditor-http.sock diff --git a/debian/taler-auditor.taler-auditor.target b/debian/taler-auditor.taler-auditor.target @@ -1,6 +1,7 @@ [Unit] +Wants=postgresql.service Description=GNU Taler auditor -After=postgres.service network.target +After=postgresql.service network.target Wants=taler-auditor-httpd.service Wants=taler-helper-auditor-aggregation.service diff --git a/debian/taler-auditor.taler-helper-auditor-aggregation.service b/debian/taler-auditor.taler-helper-auditor-aggregation.service @@ -1,27 +1,22 @@ -[Unit] -Description=GNU Taler auditor helper checking aggregations -After=postgres.service -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-aggregation -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper checking aggregations +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-aggregation -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-auditor.taler-helper-auditor-aml.service b/debian/taler-auditor.taler-helper-auditor-aml.service @@ -1,27 +1,22 @@ -[Unit] -Description=GNU Taler auditor helper verifying AML officer signatures -After=postgres.service -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-aml -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s -\ No newline at end of file +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper verifying AML officer signatures +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-aml -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-auditor.taler-helper-auditor-coins.service b/debian/taler-auditor.taler-helper-auditor-coins.service @@ -1,27 +1,22 @@ -[Unit] -Description=GNU Taler auditor helper checking coin histories -After=postgres.service -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-coins -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s -\ No newline at end of file +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper checking coin histories +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-coins -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-auditor.taler-helper-auditor-deposits.service b/debian/taler-auditor.taler-helper-auditor-deposits.service @@ -1,27 +1,22 @@ -[Unit] -Description=GNU Taler auditor helper checking confirmation deposits -After=postgres.service -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-deposits -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s -\ No newline at end of file +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper checking confirmation deposits +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-deposits -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-auditor.taler-helper-auditor-purses.service b/debian/taler-auditor.taler-helper-auditor-purses.service @@ -1,28 +1,23 @@ -[Unit] -Description=GNU Taler auditor helper checking purses -After=postgres.service -Slice=taler-auditor.slice -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-purses -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper checking purses +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +Slice=taler-auditor.slice +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-purses -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-auditor.taler-helper-auditor-reserves.service b/debian/taler-auditor.taler-helper-auditor-reserves.service @@ -1,27 +1,22 @@ -[Unit] -Description=GNU Taler auditor helper checking reserves -After=postgres.service -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-reserves -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s -\ No newline at end of file +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper checking reserves +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-reserves -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-auditor.taler-helper-auditor-transfer.service b/debian/taler-auditor.taler-helper-auditor-transfer.service @@ -1,27 +1,22 @@ -[Unit] -Description=GNU Taler auditor helper checking transfers -After=postgres.service -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-transfer -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s -\ No newline at end of file +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper checking transfers +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-transfer -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-auditor.taler-helper-auditor-wire-credit.service b/debian/taler-auditor.taler-helper-auditor-wire-credit.service @@ -1,27 +1,22 @@ -[Unit] -Description=GNU Taler auditor helper checking for missing wire credit transfers -After=postgres.service -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-wire-credit -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s -\ No newline at end of file +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper checking for missing wire credit transfers +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-wire-credit -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-auditor.taler-helper-auditor-wire-debit.service b/debian/taler-auditor.taler-helper-auditor-wire-debit.service @@ -1,27 +1,22 @@ -[Unit] -Description=GNU Taler auditor helper checking outgoing wire debit operations -After=postgres.service -PartOf=taler-auditor.target - -[Service] -User=taler-auditor-httpd -Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-wire-debit -c /etc/taler-auditor/taler-auditor.conf -L INFO -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=full -RuntimeMaxSec=3600s - -StandardOutput=journal -StandardError=journal -Slice=taler-auditor.slice - -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s -\ No newline at end of file +[Unit] +StartLimitIntervalSec=0 +Description=GNU Taler auditor helper checking outgoing wire debit operations +After=postgresql.service +PartOf=taler-auditor.target + +[Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +User=taler-auditor-httpd +Type=simple +RestartPreventExitStatus=6 9 +ExecStart=/usr/bin/taler-helper-auditor-wire-debit -c /etc/taler-auditor/taler-auditor.conf -L INFO +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=full +RuntimeMaxSec=3600s + +StandardOutput=journal +StandardError=journal +Slice=taler-auditor.slice diff --git a/debian/taler-exchange.taler-exchange-aggregator.service b/debian/taler-exchange.taler-exchange-aggregator.service @@ -1,15 +1,17 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange aggregator service PartOf=taler-exchange.target After=postgresql.service [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-aggregator Type=simple -Restart=always RestartMode=direct -RestartSec=1s -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-aggregator@.service b/debian/taler-exchange.taler-exchange-aggregator@.service @@ -5,16 +5,18 @@ # deployments. [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange aggregator service PartOf=taler-exchange.target -After=postgresql.target +After=postgresql.service [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-aggregator Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-closer.service b/debian/taler-exchange.taler-exchange-closer.service @@ -1,15 +1,17 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange closer service PartOf=taler-exchange.target After=network.target postgresql.service [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-closer Type=simple -Restart=always RestartMode=direct -RestartSec=1s -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-closer -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-dbinit-gc.service b/debian/taler-exchange.taler-exchange-dbinit-gc.service @@ -1,6 +1,6 @@ [Unit] Description=Job to remove stale data from the taler-exchange database (run as a timer) -After=postgresql.target +After=postgresql.service [Service] Type=simple diff --git a/debian/taler-exchange.taler-exchange-expire.service b/debian/taler-exchange.taler-exchange-expire.service @@ -1,15 +1,17 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange expire service PartOf=taler-exchange.target After=postgresql.service [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-expire Type=simple -Restart=always RestartMode=direct -RestartSec=1s -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-expire -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-httpd.service b/debian/taler-exchange.taler-exchange-httpd.service @@ -1,29 +1,23 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange REST API AssertPathExists=/run/taler-exchange/httpd -Requires=taler-exchange-httpd.socket taler-exchange-secmod-cs.service taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service +Requires=taler-exchange-httpd.socket After=postgresql.service network.target taler-exchange-secmod-cs.service taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-httpd Type=simple EnvironmentFile=-/etc/taler-exchange/taler-exchange.env -# Depending on the configuration, the service process kills itself and then -# needs to be restarted. Thus no significant delay on restarts. -Restart=always RestartMode=direct -RestartSec=1ms -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 -# Disable the service if more than 5 restarts are encountered within 5s. -# These are usually the systemd defaults, but can be overwritten, thus we set -# them here explicitly, as the exchange code assumes StartLimitInterval -# to be >=5s. -StartLimitBurst=5 -StartLimitInterval=5s ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal diff --git a/debian/taler-exchange.taler-exchange-httpd.socket b/debian/taler-exchange.taler-exchange-httpd.socket @@ -1,6 +1,6 @@ [Unit] +BindsTo=taler-exchange-httpd.service Description=Taler Exchange Socket -PartOf=taler-exchange-httpd.service [Socket] ListenStream=/run/taler-exchange/httpd/exchange-http.sock diff --git a/debian/taler-exchange.taler-exchange-httpd@.service b/debian/taler-exchange.taler-exchange-httpd@.service @@ -5,21 +5,21 @@ # deployments. [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange REST API at %I AssertPathExists=/run/taler-exchange/httpd -Requires=taler-exchange-httpd@%i.socket taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service +Requires=taler-exchange-httpd@%i.socket After=postgresql.service network.target taler-exchange-secmod-rsa.service taler-exchange-secmod-eddsa.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s +RestartMode=direct User=taler-exchange-httpd Type=simple -# Depending on the configuration, the service suicides and then -# needs to be restarted. -Restart=always -# Do not dally on restarts. -RestartSec=1ms -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-httpd@.socket b/debian/taler-exchange.taler-exchange-httpd@.socket @@ -1,6 +1,6 @@ [Unit] +BindsTo=taler-exchange-httpd@%i.service Description=Taler Exchange Socket at %I -PartOf=taler-exchange-httpd@%i.service [Socket] ListenStream=80 diff --git a/debian/taler-exchange.taler-exchange-sanctionscheck.service b/debian/taler-exchange.taler-exchange-sanctionscheck.service @@ -1,14 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=Exchange sanctionlist checker service -After=postgresql.target +After=postgresql.service [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-sanctionscheck Group=taler-exchange-kyc Type=simple -Restart=always RestartMode=direct -RestartSec=1s RestartPreventExitStatus=2 3 4 5 6 9 RuntimeMaxSec=3600s ExecStart=/usr/bin/taler-exchange-sanctionscheck -c /etc/taler-exchange/taler-exchange.conf -L INFO diff --git a/debian/taler-exchange.taler-exchange-secmod-cs.service b/debian/taler-exchange.taler-exchange-secmod-cs.service @@ -1,14 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange CS security module AssertPathExists=/run/taler-exchange/secmod-cs PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-secmod-cs Type=simple -Restart=always -RestartSec=100ms -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-secmod-cs -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-secmod-eddsa.service b/debian/taler-exchange.taler-exchange-secmod-eddsa.service @@ -1,14 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange EdDSA security module AssertPathExists=/run/taler-exchange/secmod-eddsa PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-secmod-eddsa Type=simple -Restart=always -RestartSec=100ms -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-secmod-eddsa -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-secmod-rsa.service b/debian/taler-exchange.taler-exchange-secmod-rsa.service @@ -1,14 +1,16 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange RSA security module AssertPathExists=/run/taler-exchange/secmod-rsa PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-secmod-rsa Type=simple -Restart=always -RestartSec=100ms -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-secmod-rsa -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-transfer.service b/debian/taler-exchange.taler-exchange-transfer.service @@ -1,15 +1,17 @@ [Unit] +StartLimitIntervalSec=0 Description=Taler Exchange Transfer Service After=network.target postgresql.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-wire Type=simple -Restart=always RestartMode=direct -RestartSec=5s -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-transfer -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange-wirewatch.service b/debian/taler-exchange.taler-exchange-wirewatch.service @@ -1,15 +1,17 @@ [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange wirewatch service After=network.target postgresql.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-wire Type=simple -Restart=always RestartMode=direct -RestartSec=1s -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 RuntimeMaxSec=3600s ExecStart=/usr/bin/taler-exchange-wirewatch -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal diff --git a/debian/taler-exchange.taler-exchange-wirewatch@.service b/debian/taler-exchange.taler-exchange-wirewatch@.service @@ -5,16 +5,18 @@ # deployments. [Unit] +StartLimitIntervalSec=0 Description=GNU Taler payment system exchange wirewatch service -After=postgresql.target +After=postgresql.service PartOf=taler-exchange.target [Service] +# DD102: retry transient failures without a start-rate limit. +Restart=always +RestartSec=10s User=taler-exchange-wire Type=simple -Restart=always -RestartSec=1s -RestartPreventExitStatus=9 +RestartPreventExitStatus=6 9 ExecStart=/usr/bin/taler-exchange-wirewatch -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal diff --git a/debian/taler-exchange.taler-exchange.target b/debian/taler-exchange.taler-exchange.target @@ -1,6 +1,10 @@ [Unit] +Wants=taler-exchange-secmod-cs.service +Wants=taler-exchange-secmod-rsa.service +Wants=taler-exchange-secmod-eddsa.service +Wants=postgresql.service Description=GNU Taler exchange -After=postgres.service network.target +After=postgresql.service network.target Wants=taler-exchange-httpd.service Wants=taler-exchange-wirewatch.service diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c @@ -18,6 +18,7 @@ * @brief helper library to facilitate generation of audit reports * @author Christian Grothoff */ +#include "platform.h" #include "report-lib.h" #include "auditor-database/preflight.h" #include "auditor-database/start.h" @@ -623,7 +624,7 @@ TALER_ARL_amount_subtract_neg_ (struct TALER_Amount *diff, } -enum GNUNET_GenericReturnValue +int TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) { TALER_ARL_cfg = c; @@ -638,7 +639,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "auditor", "BASE_URL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (TALER_ARL_cfg, @@ -649,7 +650,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "BASE_URL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_is_zero (&TALER_ARL_master_pub)) @@ -668,7 +669,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "MASTER_PUBLIC_KEY"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string ( @@ -681,7 +682,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) "MASTER_PUBLIC_KEY", "invalid key"); GNUNET_free (master_public_key_str); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Running auditor against exchange master public key `%s'\n", @@ -714,7 +715,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) "PUBLIC_KEY", "invalid key"); GNUNET_free (auditor_public_key_str); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_free (auditor_public_key_str); } @@ -754,7 +755,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "auditor", "PUBLIC_KEY/AUDITOR_PRIV_FILE"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != @@ -762,7 +763,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) "exchange", &TALER_ARL_currency)) { - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } { if ( (GNUNET_OK != @@ -775,7 +776,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Need non-zero value in section `exchange' under `CURRENCY_ROUND_UNIT'\n"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } } if (NULL == @@ -784,7 +785,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize exchange database plugin.\n"); TALER_ARL_done (); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (NULL == (TALER_ARL_adb = TALER_AUDITORDB_connect (TALER_ARL_cfg))) @@ -792,7 +793,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize auditor database plugin.\n"); TALER_ARL_done (); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (GNUNET_SYSERR == TALER_AUDITORDB_preflight (TALER_ARL_adb)) @@ -800,9 +801,9 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start session with auditor database.\n"); TALER_ARL_done (); - return GNUNET_SYSERR; + return EXIT_FAILURE; } - return GNUNET_OK; + return EXIT_SUCCESS; } diff --git a/src/auditor/report-lib.h b/src/auditor/report-lib.h @@ -338,9 +338,10 @@ TALER_ARL_setup_sessions_and_run (TALER_ARL_Analysis ana, * Setup global variables based on configuration. * * @param c configuration to use - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid configuration, + * EXIT_FAILURE for an unavailable database */ -enum GNUNET_GenericReturnValue +int TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c); diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c @@ -1246,9 +1246,10 @@ not_found: * Load configuration parameters for the auditor * server into the corresponding global variables. * - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid settings, + * EXIT_FAILURE for an unavailable dependency */ -static enum GNUNET_GenericReturnValue +static int auditor_serve_process_config (void) { bool have_auditor_public_key = false; @@ -1258,28 +1259,28 @@ auditor_serve_process_config (void) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem to interact with auditor database\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (NULL == (TAH_epg = TALER_EXCHANGEDB_connect (cfg))) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem to query exchange database\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (GNUNET_SYSERR == TALER_EXCHANGEDB_preflight (TAH_epg)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem to query exchange database\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (GNUNET_OK != TALER_config_get_currency (cfg, "exchange", &TAH_currency)) { - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } { @@ -1294,7 +1295,7 @@ auditor_serve_process_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "MASTER_PUBLIC_KEY"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string ( @@ -1307,7 +1308,7 @@ auditor_serve_process_config (void) "MASTER_PUBLIC_KEY", "invalid base32 encoding for a master public key"); GNUNET_free (master_public_key_str); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Launching auditor for exchange `%s'...\n", @@ -1332,7 +1333,7 @@ auditor_serve_process_config (void) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Invalid public key given in auditor configuration."); GNUNET_free (pub); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_free (pub); have_auditor_public_key = true; @@ -1357,7 +1358,7 @@ auditor_serve_process_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "AUDITOR", "AUDITOR_PRIV_FILE"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Loading auditor private key from %s\n", @@ -1396,7 +1397,7 @@ auditor_serve_process_config (void) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Loading auditor SPA from default location\n"); } - return GNUNET_OK; + return EXIT_SUCCESS; } @@ -1523,10 +1524,9 @@ run (void *cls, GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); - if (GNUNET_OK != - auditor_serve_process_config ()) + if (EXIT_SUCCESS != + (global_ret = auditor_serve_process_config ())) { - global_ret = EXIT_NOTCONFIGURED; GNUNET_SCHEDULER_shutdown (); return; } @@ -1551,7 +1551,7 @@ run (void *cls, case GNUNET_NO: if (! have_daemons) { - global_ret = EXIT_NOTCONFIGURED; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } @@ -1606,7 +1606,7 @@ main (int argc, options, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c @@ -1593,10 +1593,9 @@ run (void *cls, NULL); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Launching aggregation auditor\n"); - if (GNUNET_OK != - TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } @@ -1666,7 +1665,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-aml.c b/src/auditor/taler-helper-auditor-aml.c @@ -933,10 +933,9 @@ run (void *cls, NULL); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Launching AML auditor\n"); - if (GNUNET_OK != - TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } if (test_mode != 1) @@ -1004,7 +1003,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c @@ -3053,9 +3053,9 @@ run (void *cls, NULL); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Launching coins auditor\n"); - if (GNUNET_OK != TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } if (test_mode != 1) @@ -3124,7 +3124,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-deposits.c b/src/auditor/taler-helper-auditor-deposits.c @@ -438,10 +438,9 @@ run (void *cls, NULL); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Launching deposit auditor\n"); - if (GNUNET_OK != - TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } @@ -510,7 +509,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-purses.c b/src/auditor/taler-helper-auditor-purses.c @@ -1708,10 +1708,9 @@ run (void *cls, NULL); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Launching purses auditor\n"); - if (GNUNET_OK != - TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } if (test_mode != 1) @@ -1780,7 +1779,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c @@ -2132,10 +2132,9 @@ run (void *cls, NULL); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Launching reserves auditor\n"); - if (GNUNET_OK != - TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } if (GNUNET_OK != @@ -2217,7 +2216,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-transfer.c b/src/auditor/taler-helper-auditor-transfer.c @@ -1194,10 +1194,9 @@ run (void *cls, (void) args; (void) cfgfile; cfg = c; - if (GNUNET_OK != - TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } GNUNET_SCHEDULER_add_shutdown (&do_shutdown, @@ -1272,7 +1271,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c @@ -1987,10 +1987,9 @@ run (void *cls, cfg = c; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Launching wire-credit auditor\n"); - if (GNUNET_OK != - TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } if (GNUNET_OK != @@ -2101,7 +2100,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c @@ -1866,10 +1866,9 @@ run (void *cls, cfg = c; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Launching wire debit auditor\n"); - if (GNUNET_OK != - TALER_ARL_init (c)) + if (EXIT_SUCCESS != + (global_ret = TALER_ARL_init (c))) { - global_ret = EXIT_FAILURE; return; } @@ -1977,7 +1976,7 @@ main (int argc, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c @@ -475,9 +475,10 @@ shutdown_task (void *cls) /** * Parse the configuration for aggregator. * - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid settings, + * EXIT_FAILURE for an unavailable dependency */ -static enum GNUNET_GenericReturnValue +static int parse_aggregator_config (void) { enum GNUNET_GenericReturnValue enable_kyc; @@ -491,7 +492,7 @@ parse_aggregator_config (void) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Need YES or NO in section `exchange' under `ENABLE_KYC'\n"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_NO == enable_kyc) { @@ -510,7 +511,7 @@ parse_aggregator_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "ATTRIBUTE_ENCRYPTION_KEY"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_CRYPTO_hash (attr_enc_key_str, strlen (attr_enc_key_str), @@ -526,7 +527,7 @@ parse_aggregator_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "BASE_URL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, @@ -537,7 +538,7 @@ parse_aggregator_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "AGGREGATOR_IDLE_SLEEP_INTERVAL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if ( (GNUNET_OK != TALER_config_get_amount (cfg, @@ -548,7 +549,7 @@ parse_aggregator_config (void) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Need non-zero amount in section `exchange' under `CURRENCY_ROUND_UNIT'\n"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (NULL == @@ -556,7 +557,7 @@ parse_aggregator_config (void) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (GNUNET_OK != TALER_EXCHANGEDB_load_accounts (cfg, @@ -566,9 +567,9 @@ parse_aggregator_config (void) "No wire accounts configured for debit!\n"); TALER_EXCHANGEDB_disconnect (pg); pg = NULL; - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } - return GNUNET_OK; + return EXIT_SUCCESS; } @@ -1598,11 +1599,10 @@ run (void *cls, (void) cfgfile; cfg = c; - if (GNUNET_OK != - parse_aggregator_config ()) + if (EXIT_SUCCESS != + (global_ret = parse_aggregator_config ())) { cfg = NULL; - global_ret = EXIT_NOTCONFIGURED; return; } if (GNUNET_OK != @@ -1671,7 +1671,7 @@ main (int argc, options, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/exchange/taler-exchange-closer.c b/src/exchange/taler-exchange-closer.c @@ -119,9 +119,10 @@ shutdown_task (void *cls) /** * Parse the configuration for wirewatch. * - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid settings, + * EXIT_FAILURE for an unavailable dependency */ -static enum GNUNET_GenericReturnValue +static int parse_closer_config (void) { if (GNUNET_OK != @@ -133,7 +134,7 @@ parse_closer_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "BASE_URL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, @@ -144,7 +145,7 @@ parse_closer_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "CLOSER_IDLE_SLEEP_INTERVAL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if ( (GNUNET_OK != TALER_config_get_amount (cfg, @@ -155,7 +156,7 @@ parse_closer_config (void) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Need non-zero amount in section `exchange' under `CURRENCY_ROUND_UNIT'\n"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (NULL == @@ -163,7 +164,7 @@ parse_closer_config (void) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (GNUNET_OK != TALER_EXCHANGEDB_load_accounts (cfg, @@ -173,9 +174,9 @@ parse_closer_config (void) "No wire accounts configured for debit!\n"); TALER_EXCHANGEDB_disconnect (pg); pg = NULL; - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } - return GNUNET_OK; + return EXIT_SUCCESS; } @@ -536,10 +537,10 @@ run (void *cls, (void) cfgfile; cfg = c; - if (GNUNET_OK != parse_closer_config ()) + if (EXIT_SUCCESS != + (global_ret = parse_closer_config ())) { cfg = NULL; - global_ret = EXIT_NOTCONFIGURED; return; } GNUNET_assert (NULL == task); @@ -580,7 +581,7 @@ main (int argc, options, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/exchange/taler-exchange-expire.c b/src/exchange/taler-exchange-expire.c @@ -151,9 +151,10 @@ shutdown_task (void *cls) /** * Parse the configuration for expire. * - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid settings, + * EXIT_FAILURE for an unavailable dependency */ -static enum GNUNET_GenericReturnValue +static int parse_expire_config (void) { if (NULL == @@ -161,9 +162,9 @@ parse_expire_config (void) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } - return GNUNET_OK; + return EXIT_SUCCESS; } @@ -501,10 +502,10 @@ run (void *cls, (void) cfgfile; cfg = c; - if (GNUNET_OK != parse_expire_config ()) + if (EXIT_SUCCESS != + (global_ret = parse_expire_config ())) { cfg = NULL; - global_ret = EXIT_NOTCONFIGURED; return; } if (GNUNET_OK != @@ -556,7 +557,7 @@ main (int argc, options, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c @@ -2176,9 +2176,10 @@ handle_mhd_request (void *cls, * server into the corresponding global variables. * * @param cfg_fn name of our configuration file - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid settings, + * EXIT_FAILURE for an unavailable dependency */ -static enum GNUNET_GenericReturnValue +static int exchange_serve_process_config (const char *cfg_fn) { TEH_disable_direct_deposit @@ -2192,7 +2193,7 @@ exchange_serve_process_config (const char *cfg_fn) "exchange", "DISABLE_DIRECT_DEPOSIT", "Need YES or NO\n"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } TEH_enable_kyc = GNUNET_CONFIGURATION_get_value_yesno ( @@ -2205,7 +2206,7 @@ exchange_serve_process_config (const char *cfg_fn) "exchange", "ENABLE_KYC", "Need YES or NO\n"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } TEH_kyc_swap_tos_acceptance = GNUNET_CONFIGURATION_get_value_yesno ( @@ -2221,7 +2222,7 @@ exchange_serve_process_config (const char *cfg_fn) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to load configuration `%s'. Exiting.\n", cfg_fn); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } TEH_hard_limits = TALER_KYCLOGIC_get_hard_limits (); @@ -2288,7 +2289,7 @@ exchange_serve_process_config (const char *cfg_fn) "exchange", "MAX_KEYS_CACHING", "valid relative time expected"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (TEH_cfg, @@ -2316,7 +2317,7 @@ exchange_serve_process_config (const char *cfg_fn) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "CURRENCY"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != @@ -2324,7 +2325,7 @@ exchange_serve_process_config (const char *cfg_fn) TEH_currency, &num_cspecs, &cspecs)) - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; for (unsigned int i = 0; i<num_cspecs; i++) { struct TALER_CurrencySpecification *cspec; @@ -2349,7 +2350,7 @@ exchange_serve_process_config (const char *cfg_fn) &TEH_stefan_abs)) { GNUNET_break (0); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_assert (GNUNET_OK == TALER_amount_set_zero (TEH_currency, @@ -2361,7 +2362,7 @@ exchange_serve_process_config (const char *cfg_fn) &TEH_stefan_log)) { GNUNET_break (0); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if ( (GNUNET_OK != TALER_config_get_amount (TEH_cfg, @@ -2377,7 +2378,7 @@ exchange_serve_process_config (const char *cfg_fn) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "TINY_AMOUNT"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } TEH_stefan_lin = 0.0f; if (GNUNET_SYSERR == @@ -2390,7 +2391,7 @@ exchange_serve_process_config (const char *cfg_fn) "exchange", "STEFAN_LIN", "must be a floating point"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != @@ -2402,7 +2403,7 @@ exchange_serve_process_config (const char *cfg_fn) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "BASE_URL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if ( (! TALER_url_valid_charset (TEH_base_url)) || (! TALER_is_web_url (TEH_base_url) ) ) @@ -2411,7 +2412,7 @@ exchange_serve_process_config (const char *cfg_fn) "exchange", "BASE_URL", "invalid URL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (TEH_cfg, @@ -2440,7 +2441,7 @@ exchange_serve_process_config (const char *cfg_fn) "exchange", "SHOPPING_URL", "invalid URL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_filename (TEH_cfg, @@ -2485,7 +2486,7 @@ exchange_serve_process_config (const char *cfg_fn) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "MASTER_PUBLIC_KEY"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string ( @@ -2498,7 +2499,7 @@ exchange_serve_process_config (const char *cfg_fn) "MASTER_PUBLIC_KEY", "invalid base32 encoding for a master public key"); GNUNET_free (master_public_key_str); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Launching exchange with public key `%s'...\n", @@ -2518,7 +2519,7 @@ exchange_serve_process_config (const char *cfg_fn) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "ATTRIBUTE_ENCRYPTION_KEY"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } GNUNET_CRYPTO_hash (attr_enc_key_str, strlen (attr_enc_key_str), @@ -2547,7 +2548,7 @@ exchange_serve_process_config (const char *cfg_fn) "exchange", "GLOBAL_PDF_FORM_DATA", err.text); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } } } @@ -2566,9 +2567,9 @@ exchange_serve_process_config (const char *cfg_fn) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem. Giving up.\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } - return GNUNET_OK; + return EXIT_SUCCESS; } @@ -2741,7 +2742,7 @@ run_single_request (void) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "fork"); - global_ret = EXIT_NO_RESTART; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } @@ -2951,10 +2952,9 @@ run (void *cls, TALER_MHD_setup (go); TEH_cfg = config; - if (GNUNET_OK != - exchange_serve_process_config (cfgfile)) + if (EXIT_SUCCESS != + (global_ret = exchange_serve_process_config (cfgfile))) { - global_ret = EXIT_NOTCONFIGURED; GNUNET_SCHEDULER_shutdown (); return; } @@ -2968,7 +2968,9 @@ run (void *cls, if (GNUNET_OK != TALER_TEMPLATING_init (TALER_EXCHANGE_project_data ())) { - global_ret = EXIT_NOTINSTALLED; + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to load installed templates\n"); + global_ret = EXIT_NO_RESTART; GNUNET_SCHEDULER_shutdown (); return; } @@ -2976,7 +2978,7 @@ run (void *cls, TALER_EXCHANGEDB_preflight (TEH_pg)) { GNUNET_break (0); - global_ret = EXIT_NO_RESTART; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } @@ -3008,7 +3010,7 @@ run (void *cls, "Invalid AGE_GROUPS value in [exchange]: %s\n", groups); GNUNET_free (groups); - global_ret = EXIT_NOTINSTALLED; + global_ret = EXIT_NOTCONFIGURED; GNUNET_SCHEDULER_shutdown (); return; } @@ -3016,11 +3018,9 @@ run (void *cls, TEH_age_restriction_mask = mask; TEH_age_restriction_enabled = true; } - if (GNUNET_OK != - TEH_keys_init ()) + if (EXIT_SUCCESS != + (global_ret = TEH_keys_init ())) { - GNUNET_break (0); - global_ret = EXIT_NO_RESTART; GNUNET_SCHEDULER_shutdown (); return; } @@ -3032,7 +3032,7 @@ run (void *cls, if (NULL == TEH_curl_ctx) { GNUNET_break (0); - global_ret = EXIT_NO_RESTART; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } @@ -3052,7 +3052,7 @@ run (void *cls, case GNUNET_NO: if (! have_daemons) { - global_ret = EXIT_NOTCONFIGURED; + global_ret = EXIT_FAILURE; GNUNET_SCHEDULER_shutdown (); return; } @@ -3128,7 +3128,7 @@ main (int argc, options, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/exchange/taler-exchange-httpd_get-keys.c b/src/exchange/taler-exchange-httpd_get-keys.c @@ -19,6 +19,7 @@ * @author Christian Grothoff * @author Özgür Kesim */ +#include "platform.h" #include "taler/taler_json_lib.h" #include "taler/taler_mhd_lib.h" #include "taler/taler_kyclogic_lib.h" @@ -1198,14 +1199,14 @@ keys_update_event_cb (void *cls, } -enum GNUNET_GenericReturnValue +int TEH_keys_init () { if (GNUNET_OK != TEH_SECMOD_setup_key_helpers ()) { TEH_SECMOD_destroy_key_helpers (); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (TEH_cfg, @@ -1216,7 +1217,7 @@ TEH_keys_init () GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "SIGNKEY_LEGAL_DURATION"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (TEH_cfg, @@ -1243,7 +1244,7 @@ TEH_keys_init () if (NULL == keys_eh) { GNUNET_break (0); - return GNUNET_SYSERR; + return EXIT_FAILURE; } } { @@ -1260,10 +1261,10 @@ TEH_keys_init () if (NULL == wire_eh) { GNUNET_break (0); - return GNUNET_SYSERR; + return EXIT_FAILURE; } } - return GNUNET_OK; + return EXIT_SUCCESS; } diff --git a/src/exchange/taler-exchange-httpd_get-keys.h b/src/exchange/taler-exchange-httpd_get-keys.h @@ -448,9 +448,10 @@ TEH_keys_bump_generation (void); /** * Initialize keys subsystem. * - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid settings, + * EXIT_FAILURE for an unavailable database */ -enum GNUNET_GenericReturnValue +int TEH_keys_init (void); diff --git a/src/exchange/taler-exchange-sanctionscheck.c b/src/exchange/taler-exchange-sanctionscheck.c @@ -935,7 +935,7 @@ main (int argc, json_decref (freeze_rules); freeze_rules = NULL; if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/exchange/taler-exchange-transfer.c b/src/exchange/taler-exchange-transfer.c @@ -286,9 +286,10 @@ shutdown_task (void *cls) /** * Parse the configuration for taler-exchange-transfer. * - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid settings, + * EXIT_FAILURE for an unavailable dependency */ -static enum GNUNET_GenericReturnValue +static int parse_transfer_config (void) { if (GNUNET_OK != @@ -300,14 +301,14 @@ parse_transfer_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "TRANSFER_IDLE_SLEEP_INTERVAL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (NULL == (pg = TALER_EXCHANGEDB_connect (cfg))) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (GNUNET_OK != TALER_EXCHANGEDB_load_accounts (cfg, @@ -318,9 +319,9 @@ parse_transfer_config (void) "No wire accounts configured for debit!\n"); TALER_EXCHANGEDB_disconnect (pg); pg = NULL; - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } - return GNUNET_OK; + return EXIT_SUCCESS; } @@ -871,10 +872,10 @@ run (void *cls, global_ret = EXIT_INVALIDARGUMENT; return; } - if (GNUNET_OK != parse_transfer_config ()) + if (EXIT_SUCCESS != + (global_ret = parse_transfer_config ())) { cfg = NULL; - global_ret = EXIT_NOTCONFIGURED; return; } ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule, @@ -882,7 +883,7 @@ run (void *cls, if (NULL == ctx) { GNUNET_break (0); - global_ret = EXIT_NO_RESTART; + global_ret = EXIT_FAILURE; return; } rc = GNUNET_CURL_gnunet_rc_create (ctx); @@ -945,7 +946,7 @@ main (int argc, options, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c @@ -343,9 +343,10 @@ add_account_cb (void *cls, * Parse configuration parameters for the exchange server into the * corresponding global variables. * - * @return #GNUNET_OK on success + * @return EXIT_SUCCESS on success, EXIT_NOTCONFIGURED for invalid settings, + * EXIT_FAILURE for an unavailable dependency */ -static enum GNUNET_GenericReturnValue +static int exchange_serve_process_config (void) { if (GNUNET_OK != @@ -357,14 +358,14 @@ exchange_serve_process_config (void) GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", "WIREWATCH_IDLE_SLEEP_INTERVAL"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } if (NULL == (pg = TALER_EXCHANGEDB_connect (cfg))) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize DB subsystem\n"); - return GNUNET_SYSERR; + return EXIT_FAILURE; } if (GNUNET_OK != TALER_EXCHANGEDB_load_accounts (cfg, @@ -373,7 +374,7 @@ exchange_serve_process_config (void) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No wire accounts configured for credit!\n"); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } TALER_EXCHANGEDB_find_accounts (&add_account_cb, NULL); @@ -382,9 +383,9 @@ exchange_serve_process_config (void) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No accounts enabled for credit!\n"); GNUNET_SCHEDULER_shutdown (); - return GNUNET_SYSERR; + return EXIT_NOTCONFIGURED; } - return GNUNET_OK; + return EXIT_SUCCESS; } @@ -1032,10 +1033,9 @@ run (void *cls, GNUNET_SCHEDULER_shutdown (); return; } - if (GNUNET_OK != - exchange_serve_process_config ()) + if (EXIT_SUCCESS != + (global_ret = exchange_serve_process_config ())) { - global_ret = EXIT_NOTCONFIGURED; GNUNET_SCHEDULER_shutdown (); return; } @@ -1045,7 +1045,7 @@ run (void *cls, { GNUNET_break (0); GNUNET_SCHEDULER_shutdown (); - global_ret = EXIT_NO_RESTART; + global_ret = EXIT_FAILURE; return; } rc = GNUNET_CURL_gnunet_rc_create (ctx); @@ -1114,7 +1114,7 @@ main (int argc, options, &run, NULL); if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; if (GNUNET_NO == ret) return EXIT_SUCCESS; return global_ret; diff --git a/src/util/taler-exchange-secmod-cs.c b/src/util/taler-exchange-secmod-cs.c @@ -71,6 +71,6 @@ main (int argc, if (GNUNET_NO == ret) return EXIT_SUCCESS; if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; return opts.global_ret; } diff --git a/src/util/taler-exchange-secmod-eddsa.c b/src/util/taler-exchange-secmod-eddsa.c @@ -72,6 +72,6 @@ main (int argc, if (GNUNET_NO == ret) return EXIT_SUCCESS; if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; return opts.global_ret; } diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c @@ -72,6 +72,6 @@ main (int argc, if (GNUNET_NO == ret) return EXIT_SUCCESS; if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; + return EXIT_NOTCONFIGURED; return opts.global_ret; }