diff options
-rw-r--r-- | lib/server/Daemon.cpp | 11 | ||||
-rw-r--r-- | lib/server/Daemon.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp index 8b1a1786..37698101 100644 --- a/lib/server/Daemon.cpp +++ b/lib/server/Daemon.cpp @@ -53,6 +53,7 @@ Daemon::Daemon() mReloadConfigWanted(false), mTerminateWanted(false), mSingleProcess(false), + mRunInForeground(false), mKeepConsoleOpenAfterFork(false) { if(spDaemon != NULL) @@ -121,7 +122,7 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) optreset = 1; #endif - while((c = getopt(argc, (char * const *)argv, "c:DqvVt:Tk")) != -1) + while((c = getopt(argc, (char * const *)argv, "c:DFqvVt:Tk")) != -1) { switch(c) { @@ -138,6 +139,12 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) } break; + case 'F': + { + mRunInForeground = true; + } + break; + case 'q': { if(masterLevel == Log::NOTHING) @@ -250,7 +257,7 @@ int Daemon::Main(const std::string &rConfigFileName) mConfigFileName = rConfigFileName; - bool asDaemon = !mSingleProcess; + bool asDaemon = !mSingleProcess && !mRunInForeground; try { diff --git a/lib/server/Daemon.h b/lib/server/Daemon.h index c4c7af0d..bce6c3c1 100644 --- a/lib/server/Daemon.h +++ b/lib/server/Daemon.h @@ -79,6 +79,7 @@ private: bool mReloadConfigWanted; bool mTerminateWanted; bool mSingleProcess; + bool mRunInForeground; bool mKeepConsoleOpenAfterFork; static Daemon *spDaemon; }; |