From b747a6690493191d3183bb865770e4bc7cbaf8b6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 18 Jun 2015 01:33:09 +0100 Subject: Don't start the daemon components until options have been processed and process has been called --- project2/daemon/p2daemonAppEngine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/project2/daemon/p2daemonAppEngine.cpp b/project2/daemon/p2daemonAppEngine.cpp index b48b75b..f6fc178 100644 --- a/project2/daemon/p2daemonAppEngine.cpp +++ b/project2/daemon/p2daemonAppEngine.cpp @@ -53,9 +53,9 @@ END_OPTIONS(DaemonAppEngine); DaemonAppEngine::DaemonAppEngine(int argc, char ** argv) : main_loop(Glib::MainLoop::create()), - daemonFactory(boost::bind(&DaemonLoader::create, DaemonLoader::getFor(daemonType), argc, argv)) + daemonFactory(boost::bind(&DaemonLoader::create, + boost::bind(DaemonLoader::getFor, boost::cref(daemonType)), argc, argv)) { - Glib::signal_timeout().connect_seconds(sigc::mem_fun(this, &DaemonAppEngine::periodicCallback), periodicTimeout); } DaemonAppEngine::~DaemonAppEngine() @@ -96,8 +96,9 @@ DaemonAppEngine::process() IgnoreSignal(SIGUSR2); AddSignalHandler(SIGQUIT, boost::bind(&DaemonAppEngine::shutdown, this)); AddSignalHandler(SIGTERM, boost::bind(&DaemonAppEngine::shutdown, this)); - + Logger()->messagebf(LOG_DEBUG, "%s: Starting events.", __PRETTY_FUNCTION__); + Glib::signal_timeout().connect_seconds(sigc::mem_fun(this, &DaemonAppEngine::periodicCallback), periodicTimeout); evThread = new std::thread(&Glib::MainLoop::run, main_loop.operator->()); Logger()->messagebf(LOG_INFO, "%s: Starting daemon.", __PRETTY_FUNCTION__); daemon->run(); -- cgit v1.2.3