summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2009-04-09 23:05:28 +0000
committerChris Wilson <chris+github@qwirx.com>2009-04-09 23:05:28 +0000
commit2b1f41112c007c1e01f9a575817f5104aa76784f (patch)
tree501b60036c17665baa299550976321bca1243ebf /lib
parent3f4672f25c21c95d81656ad561b613a5192fe0b4 (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')
-rw-r--r--lib/common/BoxPortsAndFiles.h.in9
-rw-r--r--lib/raidfile/RaidFileController.h2
-rwxr-xr-xlib/raidfile/raidfile-config.in2
-rw-r--r--lib/server/Daemon.cpp15
4 files changed, 23 insertions, 5 deletions
diff --git a/lib/common/BoxPortsAndFiles.h.in b/lib/common/BoxPortsAndFiles.h.in
index fcc0ddce..e30dcf90 100644
--- a/lib/common/BoxPortsAndFiles.h.in
+++ b/lib/common/BoxPortsAndFiles.h.in
@@ -31,9 +31,12 @@
#define BOX_GET_DEFAULT_BBSTORED_CONFIG_FILE \
GetDefaultConfigFilePath("bbstored.conf").c_str()
#else
-#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "@sysconfdir_expanded@/box/bbackupd.conf"
-#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG "@sysconfdir_expanded@/box/raidfile.conf"
-#define BOX_FILE_BBSTORED_DEFAULT_CONFIG "@sysconfdir_expanded@/box/bbstored.conf"
+#define BOX_FILE_BBACKUPD_DEFAULT_CONFIG "@sysconfdir_expanded@/boxbackup/bbackupd.conf"
+#define BOX_FILE_RAIDFILE_DEFAULT_CONFIG "@sysconfdir_expanded@/boxbackup/raidfile.conf"
+#define BOX_FILE_BBSTORED_DEFAULT_CONFIG "@sysconfdir_expanded@/boxbackup/bbstored.conf"
+#define BOX_FILE_BBACKUPD_OLD_CONFIG "@sysconfdir_expanded@/box/bbackupd.conf"
+#define BOX_FILE_RAIDFILE_OLD_CONFIG "@sysconfdir_expanded@/box/raidfile.conf"
+#define BOX_FILE_BBSTORED_OLD_CONFIG "@sysconfdir_expanded@/box/bbstored.conf"
#endif
#endif // BOXPORTSANDFILES__H
diff --git a/lib/raidfile/RaidFileController.h b/lib/raidfile/RaidFileController.h
index 783cb055..216bdf3a 100644
--- a/lib/raidfile/RaidFileController.h
+++ b/lib/raidfile/RaidFileController.h
@@ -82,7 +82,7 @@ public:
public:
void Initialise(const std::string& rConfigFilename =
- "/etc/box/raidfile.conf");
+ "/etc/boxbackup/raidfile.conf");
int GetNumDiscSets() {return mSetList.size();}
// --------------------------------------------------------------------------
diff --git a/lib/raidfile/raidfile-config.in b/lib/raidfile/raidfile-config.in
index 76b65ace..b8ea73a5 100755
--- a/lib/raidfile/raidfile-config.in
+++ b/lib/raidfile/raidfile-config.in
@@ -19,7 +19,7 @@ Usage:
raidfile-config config-dir block-size dir0 [dir1 dir2]
Parameters:
- config-dir is usually @sysconfdir_expanded@/box
+ config-dir is usually @sysconfdir_expanded@/boxbackup
block-size must be a power of two, and usually the block or
fragment size of your file system
dir0, dir1, dir2 are the directories used as the root of the raid
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);
}