Removed exit code definitions that are no longer used
authorArt Cancro <ajc@citadel.org>
Fri, 23 Apr 2021 21:59:51 +0000 (17:59 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 23 Apr 2021 21:59:51 +0000 (17:59 -0400)
appimage/ctdlvisor.c
citadel/Makefile.in
citadel/server.h

index 7e2c25b29765e351d0e7831596b8919653f0c455..6784f2cc5d042998ca55eb2f8068dcbca87be656 100644 (file)
@@ -71,15 +71,7 @@ void signal_handler(int signal) {
                        what_exited = "unknown";
                }
                if (who_exited >= 0) {
-                       if (WIFEXITED(status)) {
-                               fprintf(stderr, "ctdlvisor: %d (%s) exited, exitcode=%d\n", who_exited, what_exited, WEXITSTATUS(status));
-                       }
-                       else if (WIFSIGNALED(status)) {
-                               fprintf(stderr, "ctdlvisor: %d (%s) crashed, signal=%d\n", who_exited, what_exited, WTERMSIG(status));
-                       }
-                       else {
-                               fprintf(stderr, "ctdlvisor: %d (%s) ended, status=%d\n", who_exited, what_exited, status);
-                       }
+                       fprintf(stderr, "ctdlvisor: %d (%s) ended, status=%d\n", who_exited, what_exited, status);
                }
        } while (who_exited >= 0);
        ctdlvisor_exit(0);
@@ -170,19 +162,22 @@ void main_loop(void) {
                // If it crashes, however, we will start it back up.
                if (who_exited == citserver_pid) {
                        citserver_exit_code = WEXITSTATUS(status);
-                       if (citserver_exit_code == 0) {
+                       if ((WIFEXITED(status)) && (citserver_exit_code == 0)) {
                                fprintf(stderr, "ctdlvisor: citserver exited normally - ending AppImage session\n");
                                shutting_down = 1;
                                kill(webcit_pid, SIGTERM);
                                kill(webcits_pid, SIGTERM);
                        }
-                       else if ((citserver_exit_code >= 101) && (citserver_exit_code <= 109)) {
+                       else if ((WIFEXITED(status)) && (citserver_exit_code >= 101) && (citserver_exit_code <= 109)) {
                                fprintf(stderr, "ctdlvisor: citserver exited intentionally - ending AppImage session\n");
                                shutting_down = 1;
                                kill(webcit_pid, SIGTERM);
                                kill(webcits_pid, SIGTERM);
                        }
                        else {
+                               if (WIFSIGNALED(status)) {
+                                       fprintf(stderr, "ctdlvisor: citserver crashed on signal %d\n", WTERMSIG(status));
+                               }
                                citserver_pid = start_citadel();
                        }
                }
index bf475dabd67d2a0d4bfe73af550ab041839170af..83d2bcb1cbd15cf01778c35c1f30657a6427c5cf 100644 (file)
@@ -48,14 +48,14 @@ CFLAGS=@CFLAGS@ -I.
 CPPFLAGS=@CPPFLAGS@ -I.
 DATABASE=@DATABASE@
 DEFS=@DEFS@ -DDIFF=\"@DIFF@\" -DPATCH=\"@PATCH@\"
-LDFLAGS=@LDFLAGS@
+LDFLAGS=@LDFLAGS@ -rdynamic
 LIBS=@LIBS@
 LIBOBJS=@LIBOBJS@
 INSTALL=@INSTALL@
 INSTALL_DATA=@INSTALL_DATA@
 RESOLV=@RESOLV@
 SHELL=/bin/sh
-SERVER_LDFLAGS=@SERVER_LDFLAGS@
+SERVER_LDFLAGS=@SERVER_LDFLAGS@ -rdynamic
 SERVER_LIBS=@SERVER_LIBS@
 SETUP_LIBS=@SETUP_LIBS@
 YACC=@YACC@
index 0be145a2003095bf0f970fcebc5cd0f55d80222c..ef7b4aa84e0eb3fadfe8912159039df030b04d8b 100644 (file)
@@ -72,9 +72,7 @@ struct recptypes {
  * restart.
  */
 #define CTDLEXIT_CONFIG                101     // Could not read system configuration
-#define CTDLEXIT_CONTROL       102     // Could not acquire lock
 #define CTDLEXIT_HOME          103     // Citadel home directory not found
-#define CTDLEXIT_OOD           104     // Out Of Date config - rerun setup
 #define CTDLEXIT_DB            105     // Unable to initialize database
 #define CTDLEXIT_LIBCITADEL    106     // Incorrect version of libcitadel
 #define CTDL_EXIT_UNSUP_AUTH   107     // Unsupported auth mode configured