dovecot-2.0: lib-master: Die on SIGINT only if we're running sta...

dovecot at dovecot.org dovecot at dovecot.org
Thu Dec 10 01:00:28 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/e6362e056ef2
changeset: 10440:e6362e056ef2
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Dec 09 18:00:17 2009 -0500
description:
lib-master: Die on SIGINT only if we're running standalone or not handling clients.

diffstat:

1 file changed, 10 insertions(+), 3 deletions(-)
src/lib-master/master-service.c |   13 ++++++++++---

diffs (28 lines):

diff -r bbdfe2ef328b -r e6362e056ef2 src/lib-master/master-service.c
--- a/src/lib-master/master-service.c	Wed Dec 09 17:58:13 2009 -0500
+++ b/src/lib-master/master-service.c	Wed Dec 09 18:00:17 2009 -0500
@@ -49,14 +49,21 @@ static void sig_die(const siginfo_t *si,
 {
 	struct master_service *service = context;
 
-	/* warn about being killed because of some signal, except SIGINT (^C)
-	   which is too common at least while testing :) */
+	/* SIGINT comes either from master process or from keyboard. we don't
+	   want to log it in either case.*/
 	if (si->si_signo != SIGINT) {
 		i_warning("Killed with signal %d (by pid=%s uid=%s code=%s)",
 			  si->si_signo, dec2str(si->si_pid),
 			  dec2str(si->si_uid),
 			  lib_signal_code_to_str(si->si_signo, si->si_code));
-	}
+	} else if ((service->flags & MASTER_SERVICE_FLAG_STANDALONE) == 0) {
+		/* SIGINT came from master. die only if we're not handling
+		   any clients currently. */
+		if (service->master_status.available_count !=
+		    service->total_available_count)
+			return;
+	}
+
 	io_loop_stop(service->ioloop);
 }
 


More information about the dovecot-cvs mailing list