From 601a4d726d676275a0ec501f1be99260866c0b65 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 9 Oct 2009 20:51:12 -0400 Subject: [PATCH] master: If config process doesn't exist when reloading config, create one to avoid hanging. --HG-- branch : HEAD --- src/master/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/master/main.c b/src/master/main.c index 8064dcabd2..1d78e6b38a 100644 --- a/src/master/main.c +++ b/src/master/main.c @@ -16,6 +16,7 @@ #include "service.h" #include "service-listen.h" #include "service-monitor.h" +#include "service-process.h" #include "service-log.h" #include @@ -331,6 +332,16 @@ sig_settings_reload(const siginfo_t *si ATTR_UNUSED, /* 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; -- 2.47.3