From: Timo Sirainen Date: Sat, 10 Oct 2009 00:51:12 +0000 (-0400) Subject: master: If config process doesn't exist when reloading config, create one to avoid... X-Git-Tag: 2.0.alpha1~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=601a4d726d676275a0ec501f1be99260866c0b65;p=thirdparty%2Fdovecot%2Fcore.git master: If config process doesn't exist when reloading config, create one to avoid hanging. --HG-- branch : HEAD --- 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;