]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Notify process creation success to master only after parsing config file
authorTimo Sirainen <tss@iki.fi>
Tue, 18 Dec 2012 19:37:57 +0000 (21:37 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 18 Dec 2012 19:37:57 +0000 (21:37 +0200)
src/config/main.c

index 32f72d58cbc91253326fc9b9109272ca745f58cb..30be8f0d1810210b8b09d63fa8d133736bca590a 100644 (file)
@@ -26,13 +26,17 @@ int main(int argc, char *argv[])
        restrict_access_by_env(NULL, FALSE);
        restrict_access_allow_coredumps(TRUE);
 
-       master_service_init_finish(master_service);
        config_parse_load_modules();
 
        path = master_service_get_config_path(master_service);
        if (config_parse_file(path, TRUE, "", &error) <= 0)
                i_fatal("%s", error);
 
+       /* notify about our success only after successfully parsing the
+          config file, so if the parsing fails, master won't immediately
+          just recreate this process (and fail again and so on). */
+       master_service_init_finish(master_service);
+
        master_service_run(master_service, client_connected);
        config_connections_destroy_all();