changeset 10031:fa9d2204b453 HEAD

master: If config process doesn't exist when reloading config, create one to avoid hanging.
author Timo Sirainen <tss@iki.fi>
date Fri, 09 Oct 2009 20:51:12 -0400
parents 364dc7ae87e4
children ebe9b1e7a46b
files src/master/main.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/main.c	Fri Oct 09 20:50:16 2009 -0400
+++ b/src/master/main.c	Fri Oct 09 20:51:12 2009 -0400
@@ -16,6 +16,7 @@
 #include "service.h"
 #include "service-listen.h"
 #include "service-monitor.h"
+#include "service-process.h"
 #include "service-log.h"
 
 #include <stdio.h>
@@ -331,6 +332,16 @@
 	/* see if hostname changed */
 	hostpid_init();
 
+	if (services->config->process_avail == 0) {
+		/* we can't reload config if there's no config process. */
+		if (service_process_create(services->config,
+					   NULL, NULL) == NULL) {
+			i_error("Can't reload configuration because "
+				"we couldn't create a config process");
+			return;
+		}
+	}
+
 	memset(&input, 0, sizeof(input));
 	input.roots = set_roots;
 	input.module = MASTER_SERVICE_NAME;