[Box Backup-commit] COMMIT r1707 - box/chris/merge/lib/server
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Thu, 28 Jun 2007 20:54:45 +0100
Author: chris
Date: 2007-06-28 20:54:45 +0100 (Thu, 28 Jun 2007)
New Revision: 1707
Modified:
box/chris/merge/lib/server/Daemon.cpp
box/chris/merge/lib/server/Daemon.h
Log:
Add a new -F option for daemons, which runs in the foreground but still
accepts multiple connections, unlike -D or SINGLEPROCESS.
Modified: box/chris/merge/lib/server/Daemon.cpp
===================================================================
--- box/chris/merge/lib/server/Daemon.cpp 2007-06-27 20:18:43 UTC (rev 1706)
+++ box/chris/merge/lib/server/Daemon.cpp 2007-06-28 19:54:45 UTC (rev 1707)
@@ -53,6 +53,7 @@
mReloadConfigWanted(false),
mTerminateWanted(false),
mSingleProcess(false),
+ mRunInForeground(false),
mKeepConsoleOpenAfterFork(false)
{
if(spDaemon != NULL)
@@ -121,7 +122,7 @@
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 @@
}
break;
+ case 'F':
+ {
+ mRunInForeground = true;
+ }
+ break;
+
case 'q':
{
if(masterLevel == Log::NOTHING)
@@ -250,7 +257,7 @@
mConfigFileName = rConfigFileName;
- bool asDaemon = !mSingleProcess;
+ bool asDaemon = !mSingleProcess && !mRunInForeground;
try
{
Modified: box/chris/merge/lib/server/Daemon.h
===================================================================
--- box/chris/merge/lib/server/Daemon.h 2007-06-27 20:18:43 UTC (rev 1706)
+++ box/chris/merge/lib/server/Daemon.h 2007-06-28 19:54:45 UTC (rev 1707)
@@ -79,6 +79,7 @@
bool mReloadConfigWanted;
bool mTerminateWanted;
bool mSingleProcess;
+ bool mRunInForeground;
bool mKeepConsoleOpenAfterFork;
static Daemon *spDaemon;
};