dovecot-2.1: master: Handle internal "out of fds" errors without...

dovecot at dovecot.org dovecot at dovecot.org
Fri Feb 17 01:20:18 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/9a501d37af3d
changeset: 14167:9a501d37af3d
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Feb 17 01:13:51 2012 +0200
description:
master: Handle internal "out of fds" errors without crashing.

diffstat:

 src/master/service-monitor.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 119195278272 -r 9a501d37af3d src/master/service-monitor.c
--- a/src/master/service-monitor.c	Fri Feb 17 00:46:46 2012 +0200
+++ b/src/master/service-monitor.c	Fri Feb 17 01:13:51 2012 +0200
@@ -398,7 +398,8 @@
 {
 	struct service *const *services;
 
-	services_log_init(service_list);
+	if (services_log_init(service_list) < 0)
+		return;
 	service_anvil_monitor_start(service_list);
 
 	if (pipe(service_list->master_dead_pipe_fd) < 0)
@@ -434,14 +435,17 @@
 		service_monitor_listen_start(service);
 	}
 
-	if (service_process_create(service_list->log) != NULL)
-		service_monitor_listen_stop(service_list->log);
+	if (service_list->log->status_fd[0] != -1) {
+		if (service_process_create(service_list->log) != NULL)
+			service_monitor_listen_stop(service_list->log);
+	}
 
 	/* start up a process for startup-services */
 	array_foreach(&service_list->services, services) {
 		struct service *service = *services;
 
-		if (service->type == SERVICE_TYPE_STARTUP) {
+		if (service->type == SERVICE_TYPE_STARTUP &&
+		    service->status_fd[0] != -1) {
 			if (service_process_create(service) != NULL)
 				service_monitor_listen_stop(service);
 		}


More information about the dovecot-cvs mailing list