[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-challenger] 01/02: fix #8030
From: |
gnunet |
Subject: |
[taler-challenger] 01/02: fix #8030 |
Date: |
Sun, 28 Jan 2024 19:42:44 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository challenger.
commit 87f3e1b3701929733f1b419629eecaf56eb66881
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jan 28 19:41:37 2024 +0100
fix #8030
---
debian/challenger-httpd.service | 2 ++
src/challenger/challenger-httpd.c | 14 +++++++-------
src/util/paths.conf | 11 ++++++-----
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/debian/challenger-httpd.service b/debian/challenger-httpd.service
index 73c5330..c8a7a53 100644
--- a/debian/challenger-httpd.service
+++ b/debian/challenger-httpd.service
@@ -5,7 +5,9 @@ Description=Challenger backend
User=challenger-httpd
Type=simple
Restart=always
+RestartMode=direct
RestartSec=1s
+RestartPreventExitStatus=2 3 4 5 6 9
RuntimeMaxSec=3600s
ExecStart=/usr/bin/challenger-httpd -c /etc/challenger/challenger.conf
diff --git a/src/challenger/challenger-httpd.c
b/src/challenger/challenger-httpd.c
index 06974d0..8c7a45d 100644
--- a/src/challenger/challenger-httpd.c
+++ b/src/challenger/challenger-httpd.c
@@ -67,7 +67,7 @@ static struct GNUNET_SCHEDULER_Task *mhd_task;
/**
* Global return code
*/
-static int result;
+static int global_ret;
/**
* The MHD Daemon
@@ -590,7 +590,7 @@ run (void *cls,
return;
}
- result = EXIT_NOTCONFIGURED;
+ global_ret = EXIT_NOTCONFIGURED;
GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
NULL);
/* setup HTTP client event loop */
@@ -600,7 +600,7 @@ run (void *cls,
if (NULL ==
(CH_db = CHALLENGER_DB_plugin_load (config)))
{
- result = EXIT_NOTINSTALLED;
+ global_ret = EXIT_NOTINSTALLED;
GNUNET_SCHEDULER_shutdown ();
return;
}
@@ -618,7 +618,7 @@ run (void *cls,
if ( (0 == port) &&
(-1 == fh) )
{
- result = EXIT_NOPERMISSION;
+ global_ret = EXIT_NOPERMISSION;
GNUNET_SCHEDULER_shutdown ();
return;
}
@@ -634,13 +634,13 @@ run (void *cls,
MHD_OPTION_END);
if (NULL == mhd)
{
- result = EXIT_FAILURE;
+ global_ret = EXIT_NO_RESTART;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to launch HTTP service, exiting.\n");
GNUNET_SCHEDULER_shutdown ();
return;
}
- result = EXIT_SUCCESS;
+ global_ret = EXIT_SUCCESS;
mhd_task = prepare_daemon ();
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Challenger-httpd ready\n");
@@ -681,5 +681,5 @@ main (int argc,
return EXIT_SUCCESS;
if (GNUNET_SYSERR == ret)
return EXIT_INVALIDARGUMENT;
- return result;
+ return global_ret;
}
diff --git a/src/util/paths.conf b/src/util/paths.conf
index 09e8c26..fb351e9 100644
--- a/src/util/paths.conf
+++ b/src/util/paths.conf
@@ -5,22 +5,23 @@
# defaults with the syntax "${VAR:-default}". Here, "default" can again
# be a $-expression.
#
-# We usually want $HOME for $CHALLENGER_HOME
+# We usually want $HOME for $CHALLENGER_HOME, but we allow testcases to
+# easily override this by setting $CHALLENGER_TEST_HOME.
#
-CHALLENGER_HOME = ${HOME:-${USERPROFILE}}
+CHALLENGER_HOME = ${CHALLENGER_TEST_HOME:-${HOME:-${USERPROFILE}}}
# see XDG Base Directory Specification at
# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
# for how these should be used.
# Persistent data storage
-CHALLENGER_DATA_HOME =
${XDG_DATA_HOME:-$CHALLENGER_HOME/.local/share}/challenger/
+CHALLENGER_DATA_HOME =
${XDG_DATA_HOME:-${CHALLENGER_HOME}/.local/share}/challenger/
# Configuration files
-CHALLENGER_CONFIG_HOME =
${XDG_CONFIG_HOME:-$CHALLENGER_HOME/.config}/challenger/
+CHALLENGER_CONFIG_HOME =
${XDG_CONFIG_HOME:-${CHALLENGER_HOME}/.config}/challenger/
# Cached data, no big deal if lost
-CHALLENGER_CACHE_HOME = ${XDG_CACHE_HOME:-$CHALLENGER_HOME/.cache}/challenger/
+CHALLENGER_CACHE_HOME =
${XDG_CACHE_HOME:-${CHALLENGER_HOME}/.cache}/challenger/
# Runtime data (i.e UNIX domain sockets, locks, always lost on system boot)
CHALLENGER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/challenger-runtime/
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.