[server] exit before writing pid file in --exit-parse-config mode

This commit is contained in:
Michael Rash 2015-12-12 06:22:40 -08:00
parent b65d766d80
commit 66458dfa49

View File

@ -172,6 +172,14 @@ main(int argc, char **argv)
clean_exit(&opts, NO_FW_CLEANUP, EXIT_SUCCESS);
}
/* Now is the right time to bail if we're just parsing the configs
*/
if(opts.exit_after_parse_config)
{
log_msg(LOG_INFO, "Configs parsed, exiting.");
clean_exit(&opts, NO_FW_CLEANUP, EXIT_SUCCESS);
}
/* Acquire pid, become a daemon or run in the foreground, write pid
* to pid file.
*/
@ -189,12 +197,6 @@ main(int argc, char **argv)
*/
init_digest_cache(&opts);
if(opts.exit_after_parse_config)
{
log_msg(LOG_INFO, "Configs parsed, exiting.");
clean_exit(&opts, NO_FW_CLEANUP, EXIT_SUCCESS);
}
#if AFL_FUZZING
/* SPA data from STDIN. */
if(opts.afl_fuzzing)