summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/main.cpp')
-rw-r--r--daemon/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/daemon/main.cpp b/daemon/main.cpp
index 5bc75ef..894bad7 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -19,6 +19,8 @@
19#include <sys/mount.h> 19#include <sys/mount.h>
20#include <fcntl.h> 20#include <fcntl.h>
21#include <sys/mman.h> 21#include <sys/mman.h>
22#include <sys/time.h>
23#include <sys/resource.h>
22#include "Child.h" 24#include "Child.h"
23#include "SessionData.h" 25#include "SessionData.h"
24#include "OlySocket.h" 26#include "OlySocket.h"
@@ -28,7 +30,6 @@
28#define DEBUG false 30#define DEBUG false
29 31
30extern Child* child; 32extern Child* child;
31extern void handleException();
32int shutdownFilesystem(); 33int shutdownFilesystem();
33static pthread_mutex_t numSessions_mutex; 34static pthread_mutex_t numSessions_mutex;
34static int numSessions = 0; 35static int numSessions = 0;
@@ -297,7 +298,10 @@ struct cmdline_t parseCommandLine(int argc, char** argv) {
297 298
298// Gator data flow: collector -> collector fifo -> sender 299// Gator data flow: collector -> collector fifo -> sender
299int main(int argc, char** argv, char* envp[]) { 300int main(int argc, char** argv, char* envp[]) {
301 // Ensure proper signal handling by making gatord the process group leader
302 // e.g. it may not be the group leader when launched as 'sudo gatord'
300 setsid(); 303 setsid();
304
301 gSessionData = new SessionData(); // Global data class 305 gSessionData = new SessionData(); // Global data class
302 logg = new Logging(DEBUG); // Set up global thread-safe logging 306 logg = new Logging(DEBUG); // Set up global thread-safe logging
303 util = new OlyUtility(); // Set up global utility class 307 util = new OlyUtility(); // Set up global utility class
@@ -314,9 +318,6 @@ int main(int argc, char** argv, char* envp[]) {
314 logg->logMessage("setpriority() failed"); 318 logg->logMessage("setpriority() failed");
315 } 319 }
316 320
317 // Initialize session data
318 gSessionData->initialize();
319
320 // Parse the command line parameters 321 // Parse the command line parameters
321 struct cmdline_t cmdline = parseCommandLine(argc, argv); 322 struct cmdline_t cmdline = parseCommandLine(argc, argv);
322 323