diff options
Diffstat (limited to 'lib/server')
-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); } |