--- src/core/mwcollect.cpp (revision 250) +++ src/core/mwcollect.cpp (revision 251) @@ -246,4 +246,14 @@ } + if(!pCollector->start()) + { + g_pLogManager->log(LT_LEVEL_CRITICAL | LT_STATUS, "Startup failed, aborting!"); + + delete pCollector; + delete g_pLogManager; + + return -1; + } + if(szChuid) { // needs to be done before chrooting @@ -285,4 +295,5 @@ if(szChuid) { + DEBUG("Changing UID to %s (%i) %s setting capabilties.", szChuid, (int) uid, bCaps ? "with" : "without"); #ifdef LINUX_FLAVOURED @@ -303,16 +303,6 @@ } } - if(!pCollector->start()) - { - g_pLogManager->log(LT_LEVEL_CRITICAL | LT_STATUS, "Startup failed, aborting!"); - - delete pCollector; - delete g_pLogManager; - - return -1; - } - if(bDaemon && (pid = fork())) { FILE * pPidFile = fopen(szPidFile, "wt"); --- src/log-file/log-file.cpp (revision 134) +++ src/log-file/log-file.cpp (revision 251) @@ -7,4 +7,7 @@ #include "log-file.h" + +#include +#include @@ -40,7 +40,7 @@ if(!(pFile = fopen(szFileName, "at"))) { - LOG(LT_LEVEL_CRITICAL | LT_STATUS, "Could not open logfile \"%s\" for writing!", szFileName); + LOG(LT_LEVEL_CRITICAL | LT_STATUS, "Could not open logfile \"%s\" for writing!", szFileName, strerror(errno)); return false; }