New server option -b to specify the name of a file to which backtrace should be writt...
[citadel.git] / citadel / citserver.c
index b9648f6f70a3ba3b3b5759e992d1069477583070..48c4f5ac204cd70e61547ebd5aa868f3e4bace40 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Main source module for the Citadel server
  *
- * Copyright (c) 1987-2020 by the citadel.org team
+ * Copyright (c) 1987-2021 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -33,6 +33,7 @@ int ScheduledShutdown = 0;
 time_t server_startup_time;
 int panic_fd;
 int openid_level_supported = 0;
+char *backtrace_filename = NULL;
 
 
 /*
@@ -54,12 +55,13 @@ void master_startup(void)
        syslog(LOG_INFO, "Checking directory access");
        if ((pw = getpwuid(ctdluid)) == NULL) {
                gid = getgid();
-       } else {
+       }
+       else {
                gid = pw->pw_gid;
        }
 
        if (create_run_directories(CTDLUID, gid) != 0) {
-               syslog(LOG_EMERG, "failed to access & create directories");
+               syslog(LOG_ERR, "citserver: failed to access and create directories");
                exit(1);
        }
        syslog(LOG_INFO, "Opening databases");
@@ -123,7 +125,6 @@ void master_startup(void)
  */
 int master_cleanup(int exitcode)
 {
-       struct CleanupFunctionHook *fcn;
        static int already_cleaning_up = 0;
 
        if (already_cleaning_up) {
@@ -133,11 +134,6 @@ int master_cleanup(int exitcode)
        }
        already_cleaning_up = 1;
 
-       /* Run any cleanup routines registered by loadable modules */
-       for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
-               (*fcn->h_function_pointer) ();
-       }
-
        /* Do system-dependent stuff */
        sysdep_master_cleanup();
 
@@ -145,7 +141,7 @@ int master_cleanup(int exitcode)
        shutdown_config_system();
 
        /* Close databases */
-       syslog(LOG_INFO, "Closing databases\n");
+       syslog(LOG_INFO, "citserver: closing databases");
        close_databases();
 
        /* If the operator requested a halt but not an exit, halt here. */