$Log$
+ Revision 640.9 2005/02/16 18:48:39 ajc
+ * Try to reach our cleanup routine when SIGSEGV is caught. Hopefully
+ we'll get there and we can close the databases cleanly.
+
Revision 640.8 2005/02/16 17:37:16 ajc
* Be more aggressive about shutting down when told to. Getting the
databases closed is the highest priority.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
*/
void master_cleanup(void) {
struct CleanupFunctionHook *fcn;
+ static int already_cleaning_up = 0;
+
+ if (already_cleaning_up) while(1) sleep(1);
+ already_cleaning_up = 1;
/* Run any cleanup routines registered by loadable modules */
for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
volatile int time_to_die = 0;
static RETSIGTYPE signal_cleanup(int signum) {
- lprintf(CTDL_DEBUG, "Signal %d received.\n", signum);
+ lprintf(CTDL_DEBUG, "Caught signal %d; shutting down.\n", signum);
time_to_die = 1;
master_cleanup(); /* will this work? */
}
signal(SIGQUIT, signal_cleanup);
signal(SIGHUP, signal_cleanup);
signal(SIGTERM, signal_cleanup);
+ signal(SIGSEGV, signal_cleanup);
/*
* Do not shut down the server on broken pipe signals, otherwise the