summaryrefslogtreecommitdiff
path: root/lib/server/Daemon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/server/Daemon.cpp')
-rw-r--r--lib/server/Daemon.cpp108
1 files changed, 0 insertions, 108 deletions
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp
index 9b96647b..7419f973 100644
--- a/lib/server/Daemon.cpp
+++ b/lib/server/Daemon.cpp
@@ -25,19 +25,6 @@
#ifdef WIN32
#include <ws2tcpip.h>
-<<<<<<< HEAD
-#endif
-
-#include <iostream>
-
-#include "Daemon.h"
-#include "Configuration.h"
-#include "ServerException.h"
-#include "Guards.h"
-#include "UnixUser.h"
-#include "FileModificationTime.h"
-#include "Logging.h"
-=======
#include <process.h>
#endif
@@ -56,7 +43,6 @@
#include "Logging.h"
#include "ServerException.h"
#include "UnixUser.h"
->>>>>>> 0.12
#include "Utils.h"
#include "MemLeakFindOn.h"
@@ -85,10 +71,7 @@ Daemon::Daemon()
mKeepConsoleOpenAfterFork(false),
#endif
mHaveConfigFile(false),
-<<<<<<< HEAD
-=======
mLogFileLevel(Log::INVALID),
->>>>>>> 0.12
mAppName(DaemonName())
{
// In debug builds, switch on assert failure logging to syslog
@@ -125,25 +108,16 @@ std::string Daemon::GetOptionString()
{
return "c:"
#ifndef WIN32
-<<<<<<< HEAD
- "DFK"
- #endif
- "hkPqQt:TUvVW:";
-=======
"DF"
#endif
"hkKo:O:PqQt:TUvVW:";
->>>>>>> 0.12
}
void Daemon::Usage()
{
std::cout <<
DaemonBanner() << "\n"
-<<<<<<< HEAD
-=======
"(built with QDBM " << dpversion << ")\n"
->>>>>>> 0.12
"\n"
"Usage: " << mAppName << " [options] [config file]\n"
"\n"
@@ -156,20 +130,6 @@ void Daemon::Usage()
" -F Do not fork into background, but fork to serve multiple clients\n"
#endif
" -k Keep console open after fork, keep writing log messages to it\n"
-<<<<<<< HEAD
-#ifndef WIN32
- " -K Stop writing log messages to console while daemon is running\n"
- " -P Show process ID (PID) in console output\n"
-#endif
- " -q Run more quietly, reduce verbosity level by one, can repeat\n"
- " -Q Run at minimum verbosity, log nothing\n"
- " -v Run more verbosely, increase verbosity level by one, can repeat\n"
- " -V Run at maximum verbosity, log everything\n"
- " -W <level> Set verbosity to error/warning/notice/info/trace/everything\n"
- " -t <tag> Tag console output with specified marker\n"
- " -T Timestamp console output\n"
- " -U Timestamp console output with microseconds\n";
-=======
" -K Stop writing log messages to console while daemon is running\n"
" -o <file> Log to a file, defaults to maximum verbosity\n"
" -O <level> Set file log verbosity to error/warning/notice/info/trace/everything\n"
@@ -183,7 +143,6 @@ void Daemon::Usage()
" -V Run at maximum verbosity, log everything to console and system\n"
" -W <level> Set verbosity to error/warning/notice/info/trace/everything\n"
;
->>>>>>> 0.12
}
// --------------------------------------------------------------------------
@@ -222,8 +181,6 @@ int Daemon::ProcessOption(signed int option)
break;
#endif // !WIN32
-<<<<<<< HEAD
-=======
case 'h':
{
Usage();
@@ -231,7 +188,6 @@ int Daemon::ProcessOption(signed int option)
}
break;
->>>>>>> 0.12
case 'k':
{
mKeepConsoleOpenAfterFork = true;
@@ -244,12 +200,6 @@ int Daemon::ProcessOption(signed int option)
}
break;
-<<<<<<< HEAD
- case 'h':
- {
- Usage();
- return 2;
-=======
case 'o':
{
mLogFile = optarg;
@@ -265,7 +215,6 @@ int Daemon::ProcessOption(signed int option)
BOX_FATAL("Invalid logging level: " << optarg);
return 2;
}
->>>>>>> 0.12
}
break;
@@ -294,8 +243,6 @@ int Daemon::ProcessOption(signed int option)
}
break;
-<<<<<<< HEAD
-=======
case 't':
{
Logging::SetProgramName(optarg);
@@ -315,7 +262,6 @@ int Daemon::ProcessOption(signed int option)
Console::SetShowTimeMicros(true);
}
break;
->>>>>>> 0.12
case 'v':
{
@@ -341,39 +287,12 @@ int Daemon::ProcessOption(signed int option)
mLogLevel = Logging::GetNamedLevel(optarg);
if (mLogLevel == Log::INVALID)
{
-<<<<<<< HEAD
- BOX_FATAL("Invalid logging level");
-=======
BOX_FATAL("Invalid logging level: " << optarg);
->>>>>>> 0.12
return 2;
}
}
break;
-<<<<<<< HEAD
- case 't':
- {
- Logging::SetProgramName(optarg);
- Console::SetShowTag(true);
- }
- break;
-
- case 'T':
- {
- Console::SetShowTime(true);
- }
- break;
-
- case 'U':
- {
- Console::SetShowTime(true);
- Console::SetShowTimeMicros(true);
- }
- break;
-
-=======
->>>>>>> 0.12
case '?':
{
BOX_FATAL("Unknown option on command line: "
@@ -403,18 +322,6 @@ int Daemon::ProcessOption(signed int option)
// Created: 2003/07/29
//
// --------------------------------------------------------------------------
-<<<<<<< HEAD
-int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[])
-{
- // Find filename of config file
- mConfigFileName = DefaultConfigFile;
- mAppName = argv[0];
-
- #ifdef BOX_RELEASE_BUILD
- mLogLevel = Log::NOTICE; // need an int to do math with
- #else
- mLogLevel = Log::INFO; // need an int to do math with
-=======
int Daemon::Main(const std::string& rDefaultConfigFile, int argc,
const char *argv[])
{
@@ -448,7 +355,6 @@ int Daemon::ProcessOptions(int argc, const char *argv[])
mLogLevel = Log::NOTICE;
#else
mLogLevel = Log::INFO;
->>>>>>> 0.12
#endif
if (argc == 2 && strcmp(argv[1], "/?") == 0)
@@ -503,9 +409,6 @@ int Daemon::ProcessOptions(int argc, const char *argv[])
Logging::FilterConsole((Log::Level)mLogLevel);
Logging::FilterSyslog ((Log::Level)mLogLevel);
-<<<<<<< HEAD
- return Main(mConfigFileName);
-=======
if (mLogFileLevel != Log::INVALID)
{
mapLogFileLogger.reset(
@@ -513,7 +416,6 @@ int Daemon::ProcessOptions(int argc, const char *argv[])
}
return 0;
->>>>>>> 0.12
}
// --------------------------------------------------------------------------
@@ -535,11 +437,7 @@ bool Daemon::Configure(const std::string& rConfigFileName)
try
{
-<<<<<<< HEAD
- if (!FileExists(rConfigFileName.c_str()))
-=======
if (!FileExists(rConfigFileName))
->>>>>>> 0.12
{
BOX_FATAL("The main configuration file for " <<
DaemonName() << " was not found: " <<
@@ -1127,11 +1025,6 @@ void Daemon::SetProcessTitle(const char *format, ...)
char title[256];
::vsnprintf(title, sizeof(title), format, args);
-<<<<<<< HEAD
- // Set process title
- ::setproctitle("%s", title);
-
-=======
#ifdef WIN32
StringCchCatA(title, sizeof(title)," - " PACKAGE_NAME);
SetConsoleTitleA(title);
@@ -1140,7 +1033,6 @@ void Daemon::SetProcessTitle(const char *format, ...)
::setproctitle("%s", title);
#endif
->>>>>>> 0.12
#endif // HAVE_SETPROCTITLE
}