gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-challenger] branch master updated (9a7b2c8 -> 5c3a003)


From: gnunet
Subject: [taler-challenger] branch master updated (9a7b2c8 -> 5c3a003)
Date: Sun, 28 Jan 2024 19:42:43 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository challenger.

    from 9a7b2c8  use sane default for DB name
     new 87f3e1b  fix #8030
     new 5c3a003  fix #8030

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 debian/challenger-httpd.service   |  2 ++
 src/challenger/challenger-httpd.c | 14 +++++++-------
 src/include/platform.h            | 29 +++++++++++++++++++++++++++++
 src/util/paths.conf               | 11 ++++++-----
 4 files changed, 44 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/include/platform.h b/src/include/platform.h
index 45ebcc1..51782d3 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -243,22 +243,42 @@ atoll (const char *nptr);
 
 /* LSB-style exit status codes */
 #ifndef EXIT_INVALIDARGUMENT
+/**
+ * Command-line arguments are invalid.
+ * Restarting useless.
+ */
 #define EXIT_INVALIDARGUMENT 2
 #endif
 
 #ifndef EXIT_NOTIMPLEMENTED
+/**
+ * The requested operation is not implemented.
+ * Restarting useless.
+ */
 #define EXIT_NOTIMPLEMENTED 3
 #endif
 
 #ifndef EXIT_NOPERMISSION
+/**
+ * Permissions needed to run are not available.
+ * Restarting useless.
+ */
 #define EXIT_NOPERMISSION 4
 #endif
 
 #ifndef EXIT_NOTINSTALLED
+/**
+ * Key resources are not installed.
+ * Restarting useless.
+ */
 #define EXIT_NOTINSTALLED 5
 #endif
 
 #ifndef EXIT_NOTCONFIGURED
+/**
+ * Key configuration settings are missing or invalid.
+ * Restarting useless.
+ */
 #define EXIT_NOTCONFIGURED 6
 #endif
 
@@ -267,6 +287,15 @@ atoll (const char *nptr);
 #endif
 
 
+#ifndef EXIT_NO_RESTART
+/**
+ * Exit code from 'main' if we do not want to be restarted,
+ * except by manual intervention (hard failure).
+ */
+#define EXIT_NO_RESTART 9
+#endif
+
+
 /* Ignore MHD deprecations for now as we want to be compatible
    to "ancient" MHD releases. */
 #define MHD_NO_DEPRECATION 1
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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]