Now daemonizing after the configuration rather than before so that more errors are caught on the command line rather than via an ASYNC process

This commit is contained in:
John Sharratt 2017-07-01 13:09:46 +02:00
parent 55ad4b11f0
commit 2f10118a5c

View File

@ -271,6 +271,9 @@ int main(int argc, char* argv[], char* env[])
if (cf.is_null()) if (cf.is_null())
return -1; return -1;
if (!configure(cf))
return -1;
if (daemon) { if (daemon) {
logger::syslog(true); logger::syslog(true);
@ -280,9 +283,6 @@ int main(int argc, char* argv[], char* env[])
} }
} }
if (!configure(cf))
return -1;
if (!pidfile.empty()) { if (!pidfile.empty()) {
std::ofstream pf; std::ofstream pf;
pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc); pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc);