summaryrefslogtreecommitdiff
blob: 0edb8fecf20e8a20c33017cf3ea714942fae5cf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Index: mwcollect3/trunk/src/core/mwcollect.cpp
===================================================================
--- mwcollect3/trunk/src/core/mwcollect.cpp (revision 250)
+++ mwcollect3/trunk/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
@@ -313,14 +324,4 @@
 			}
 			
-			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()))
 			{
Index: mwcollect3/trunk/src/log-file/log-file.cpp
===================================================================
--- mwcollect3/trunk/src/log-file/log-file.cpp (revision 134)
+++ mwcollect3/trunk/src/log-file/log-file.cpp (revision 251)
@@ -7,4 +7,7 @@
 
 #include "log-file.h"
+
+#include <errno.h>
+#include <string.h>
 
 
@@ -41,5 +44,5 @@
 	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: %s!", szFileName, strerror(errno));
 		return false;
 	}