diff options
author | Reinhard Tartler <siretart@tauware.de> | 2009-04-13 09:36:22 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2009-04-13 09:36:22 +0200 |
commit | b591c86a418e8d5a0d1c1afd319d9acdad6fd4e3 (patch) | |
tree | dbd40985e2ad6fd3bee55c4613f55ed29ecda7ce /lib/server/Daemon.cpp | |
parent | a84d45498bd861c9225080232948a99c2e317bb8 (diff) |
Import upstream version 0.11~rc3~r2502
Diffstat (limited to 'lib/server/Daemon.cpp')
-rw-r--r-- | lib/server/Daemon.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp index d868774f..c4026395 100644 --- a/lib/server/Daemon.cpp +++ b/lib/server/Daemon.cpp @@ -32,6 +32,7 @@ #include "UnixUser.h" #include "FileModificationTime.h" #include "Logging.h" +#include "Utils.h" #include "MemLeakFindOn.h" @@ -336,6 +337,7 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) if (argc > optind && !mHaveConfigFile) { mConfigFileName = argv[optind]; optind++; + mHaveConfigFile = true; } if (argc > optind && ::strcmp(argv[optind], "SINGLEPROCESS") == 0) @@ -375,6 +377,20 @@ bool Daemon::Configure(const std::string& rConfigFileName) try { + if (!FileExists(rConfigFileName.c_str())) + { + BOX_FATAL("The main configuration file for " << + DaemonName() << " was not found: " << + rConfigFileName); + if (!mHaveConfigFile) + { + BOX_WARNING("The default configuration " + "directory has changed from /etc/box " + "to /etc/boxbackup"); + } + return false; + } + apConfig = Configuration::LoadAndVerify(rConfigFileName, GetConfigVerify(), errors); } |