diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-04-09 23:05:28 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-04-09 23:05:28 +0000 |
commit | 2b1f41112c007c1e01f9a575817f5104aa76784f (patch) | |
tree | 501b60036c17665baa299550976321bca1243ebf /lib/server | |
parent | 3f4672f25c21c95d81656ad561b613a5192fe0b4 (diff) |
Change default location for config files from /etc/box to
/etc/boxbackup, thanks to Reinhard Tartler and the Debian Project.
Diffstat (limited to 'lib/server')
-rw-r--r-- | lib/server/Daemon.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp index d868774f..e8b467f2 100644 --- a/lib/server/Daemon.cpp +++ b/lib/server/Daemon.cpp @@ -336,6 +336,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 +376,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); } |