From: Art Cancro Date: Wed, 16 Feb 2005 17:37:17 +0000 (+0000) Subject: * Be more aggressive about shutting down when told to. Getting the X-Git-Tag: v7.86~5045 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=5ba3f65775c52aea24f0bc7a9bc02508c480f189 * Be more aggressive about shutting down when told to. Getting the databases closed is the highest priority. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 80515f3c0..76fa15481 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + 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. + Revision 640.7 2005/02/16 04:08:42 ajc * newinstall.sh: put the checksum files server-side to avoid unnecessary downloads @@ -6400,3 +6404,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/database_sleepycat.c b/citadel/database_sleepycat.c index 9b1b740f3..193a327b0 100644 --- a/citadel/database_sleepycat.c +++ b/citadel/database_sleepycat.c @@ -415,16 +415,18 @@ void close_databases(void) cdb_free_tsd(); if ((ret = dbenv->txn_checkpoint(dbenv, 0, 0, 0))) { - lprintf(CTDL_EMERG, "cdb_*: txn_checkpoint: %s\n", db_strerror(ret)); - abort(); + lprintf(CTDL_EMERG, + "cdb_*: txn_checkpoint: %s\n", + db_strerror(ret)); } for (a = 0; a < MAXCDB; ++a) { lprintf(CTDL_INFO, "cdb_*: Closing database %d\n", a); ret = dbp[a]->close(dbp[a], 0); if (ret) { - lprintf(CTDL_EMERG, "cdb_*: db_close: %s\n", db_strerror(ret)); - abort(); + lprintf(CTDL_EMERG, + "cdb_*: db_close: %s\n", + db_strerror(ret)); } } @@ -432,8 +434,9 @@ void close_databases(void) /* Close the handle. */ ret = dbenv->close(dbenv, 0); if (ret) { - lprintf(CTDL_EMERG, "cdb_*: DBENV->close: %s\n", db_strerror(ret)); - abort(); + lprintf(CTDL_EMERG, + "cdb_*: DBENV->close: %s\n", + db_strerror(ret)); } } diff --git a/citadel/housekeeping.c b/citadel/housekeeping.c index 788fd913b..1b8deeb9a 100644 --- a/citadel/housekeeping.c +++ b/citadel/housekeeping.c @@ -82,6 +82,7 @@ void check_sched_shutdown(void) { if ((ScheduledShutdown == 1) && (ContextList == NULL)) { lprintf(CTDL_NOTICE, "Scheduled shutdown initiating.\n"); time_to_die = 1; + master_cleanup(); } } diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 353ab0ed8..e100ec67c 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -171,7 +171,9 @@ void lprintf(enum LogLevel loglevel, const char *format, ...) { volatile int time_to_die = 0; static RETSIGTYPE signal_cleanup(int signum) { + lprintf(CTDL_DEBUG, "Signal %d received.\n", signum); time_to_die = 1; + master_cleanup(); /* will this work? */ } @@ -525,7 +527,9 @@ void client_write(char *buf, int nbytes) int bytes_written = 0; int retval; int sock; +#ifndef HAVE_TCP_BUFFERING int old_buffer_len = 0; +#endif if (CC->redirect_fp != NULL) { fwrite(buf, (size_t)nbytes, (size_t)1, CC->redirect_fp);