int App::daemonMainLoop(int /*unused*/, const char** /*unused*/) { #if SYSAPI_WIN32 SystemLogger sysLogger(daemonName(), false); #else SystemLogger sysLogger(daemonName(), true); #endif return mainLoop(); }
int CApp::daemonMainLoop(int, const char**) { #if SYSAPI_WIN32 CSystemLogger sysLogger(daemonName(), false); #else CSystemLogger sysLogger(daemonName(), true); #endif return mainLoop(); }
static int daemonMainLoop(int, const char**) { #if SYSAPI_WIN32 CSystemLogger sysLogger(DAEMON_NAME, false); #else CSystemLogger sysLogger(DAEMON_NAME, true); #endif return mainLoop(); }
int CAppUtilWindows::daemonNTStartup(int, char**) { CSystemLogger sysLogger(app().daemonName(), false); m_exitMode = kExitModeDaemon; return ARCH->daemonize(app().daemonName(), daemonNTMainLoopStatic); }
static int daemonMainLoop(int, const char**) { CSystemLogger sysLogger(DAEMON_NAME); return mainLoop(); }
static int daemonStartup(int, const char**) { CSystemLogger sysLogger(DAEMON_NAME); return realMain(); }
static int daemonStartup95(int, const char**) { CSystemLogger sysLogger(DAEMON_NAME); return runMainInThread(); }
static int daemonNTStartup(int, char**) { CSystemLogger sysLogger(DAEMON_NAME); bye = &byeThrow; return ARCH->daemonize(DAEMON_NAME, &daemonNTMainLoop); }
static int run(int argc, char** argv) { // windows NT family starts services using no command line options. // since i'm not sure how to tell the difference between that and // a user providing no options we'll assume that if there are no // arguments and we're on NT then we're being invoked as a service. // users on NT can use `--daemon' or `--no-daemon' to force us out // of the service code path. if (argc <= 1 && !CArchMiscWindows::isWindows95Family()) { try { return ARCH->daemonize(DAEMON_NAME, &daemonStartup); } catch (XArchDaemon& e) { LOG((CLOG_CRIT "failed to start as a service: %s" BYE, e.what().c_str(), ARG->m_pname)); } return kExitFailed; } // parse command line parse(argc, argv); // daemonize if requested if (ARG->m_daemon) { // start as a daemon if (CArchMiscWindows::isWindows95Family()) { try { return ARCH->daemonize(DAEMON_NAME, &daemonStartup95); } catch (XArchDaemon& e) { LOG((CLOG_CRIT "failed to start as a service: %s" BYE, e.what().c_str(), ARG->m_pname)); } return kExitFailed; } else { // cannot start a service from the command line so just // run normally (except with log messages redirected). CSystemLogger sysLogger(DAEMON_NAME); return runMainInThread(); } } else { // run return runMainInThread(); } }
static int daemonStartup(int argc, const char** argv) { CSystemLogger sysLogger(DAEMON_NAME); // have to cancel this thread to quit s_taskBarReceiver->setQuitJob(new CQuitJob(CThread::getCurrentThread())); // catch errors that would normally exit bye = &byeThrow; // parse command line parse(argc, argv); // cannot run as backend if running as a service ARG->m_backend = false; // run as a service return CArchMiscWindows::runDaemon(realMain); }