diff --git a/src/server/connections.c b/src/server/connections.c index 538f7075a3eb408d8166a13567a6b8d8cedeb9ba..455b8eb699493cbde513ecbfba9579713be449cf 100644 --- a/src/server/connections.c +++ b/src/server/connections.c @@ -6,7 +6,7 @@ * Created by Willf|r 31/3-90. Mostly written by ceder. */ -static char *rcsid = "$Id: connections.c,v 0.8 1991/08/28 02:21:52 ceder Exp $"; +static char *rcsid = "$Id: connections.c,v 0.9 1991/08/30 01:32:50 ceder Exp $"; #include <errno.h> @@ -44,7 +44,22 @@ static char *rcsid = "$Id: connections.c,v 0.8 1991/08/28 02:21:52 ceder Exp $"; ISCMCB * kom_server_mcb = NULL; Connection * active_connection = NULL; +/* + * This is set TRUE when the server should be closed. It is checked + * each time around the main loop. It is set if someone with enough + * privileges issues a `shutdown', or of lyskomd receives a SIGHUP. + * This not an abort: all data is saved before we exit. + */ volatile Bool go_and_die = FALSE; + +/* + * Once upon a time the entire database was always held in core, and + * saved to disk when we got a SIGUSR1 signal. Nowadays the server + * keeps track of the time itself and saves at appropriate intervalls. + * It does still write some statistics when it get a SIGUSR1 signal. + * The signal handler sets do_sync_db. The name is retained for + * historical reasons. + */ volatile Bool do_sync_db = FALSE; jmp_buf parse_env; @@ -760,11 +775,15 @@ toploop(void) { if (do_sync_db) { - cache_sync(); /* A noop in diskomd. Actually + /* + * do_sync_db used to save the entire database. Nowadays + * all it does is to print some statistics. + */ + cache_sync(); /* A noop in lyskomd. Actually stops the server and dumps everything in ramkomd. */ dump_statistics(); - do_sync_db = 0; + do_sync_db = FALSE; } gettimeofday(&before, NULL);