diff options
-rwxr-xr-x | bin/bbackupd/bbackupd-config.in | 4 | ||||
-rwxr-xr-x | bin/bbstored/bbstored-config.in | 4 | ||||
-rw-r--r-- | contrib/debian/bbackupd.in | 2 | ||||
-rw-r--r-- | contrib/debian/bbstored.in | 2 | ||||
-rw-r--r-- | lib/common/BoxPortsAndFiles.h.in | 9 | ||||
-rw-r--r-- | lib/raidfile/RaidFileController.h | 2 | ||||
-rwxr-xr-x | lib/raidfile/raidfile-config.in | 2 | ||||
-rw-r--r-- | lib/server/Daemon.cpp | 15 |
8 files changed, 29 insertions, 11 deletions
diff --git a/bin/bbackupd/bbackupd-config.in b/bin/bbackupd/bbackupd-config.in index 925dcc3e..98dc8b6e 100755 --- a/bin/bbackupd/bbackupd-config.in +++ b/bin/bbackupd/bbackupd-config.in @@ -19,7 +19,7 @@ Usage: working-dir [backup directories] Parameters: - config-dir is usually @sysconfdir_expanded@/box + config-dir is usually @sysconfdir_expanded@/boxbackup backup-mode is lazy or snapshot: lazy mode runs continously, uploading files over a specified age snapshot mode uploads a snapshot of the filesystem when instructed @@ -57,7 +57,7 @@ __E } # default locations -my $default_config_location = '@sysconfdir_expanded@/box/bbackupd.conf'; +my $default_config_location = '@sysconfdir_expanded@/boxbackup/bbackupd.conf'; # command line parameters my ($config_dir,$backup_mode,$account_num,$server,$working_dir,@tobackup) = @ARGV; diff --git a/bin/bbstored/bbstored-config.in b/bin/bbstored/bbstored-config.in index 5ad96d50..83305c4f 100755 --- a/bin/bbstored/bbstored-config.in +++ b/bin/bbstored/bbstored-config.in @@ -19,7 +19,7 @@ Usage: bbstored-config config-dir server-hostname username [raidfile-config] Parameters: - config-dir is usually @sysconfdir_expanded@/box + config-dir is usually @sysconfdir_expanded@/boxbackup server-hostname is the hostname that clients will use to connect to this server username is the user to run the server under @@ -47,7 +47,7 @@ __E } # default locations -my $default_config_location = '@sysconfdir_expanded@/box/bbstored.conf'; +my $default_config_location = '@sysconfdir_expanded@/boxbackup/bbstored.conf'; # command line parameters my ($config_dir,$server,$username,$raidfile_config) = @ARGV; diff --git a/contrib/debian/bbackupd.in b/contrib/debian/bbackupd.in index bb7536b5..c340939a 100644 --- a/contrib/debian/bbackupd.in +++ b/contrib/debian/bbackupd.in @@ -7,7 +7,7 @@ NAME=bbackupd LONGNAME="Box Backup Client daemon" BINARY=@sbindir_expanded@/$NAME -CONFIG=@sysconfdir_expanded@/box/$NAME.conf +CONFIG=@sysconfdir_expanded@/boxbackup/$NAME.conf PIDFILE=@localstatedir_expanded@/bbackupd/$NAME.pid test -x $BINARY || exit 0 diff --git a/contrib/debian/bbstored.in b/contrib/debian/bbstored.in index 48fc47f1..c9214537 100644 --- a/contrib/debian/bbstored.in +++ b/contrib/debian/bbstored.in @@ -7,7 +7,7 @@ NAME=bbstored LONGNAME="Box Backup Server daemon" BINARY=@sbindir_expanded@/$NAME -CONFIG=@sysconfdir_expanded@/box/$NAME.conf +CONFIG=@sysconfdir_expanded@/boxbackup/$NAME.conf PIDFILE=@localstatedir_expanded@/run/$NAME.pid test -x $BINARY || exit 0 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); } |