mirror of https://gitee.com/bigwinds/arangodb
Merge remote-tracking branch 'origin/1.4' into devel
Conflicts: CHANGELOG arangosh/ArangoShell/ArangoClient.cpp
This commit is contained in:
commit
8dbdf55165
|
@ -100,6 +100,12 @@ v1.5.x (XXXX-XX-XX)
|
|||
currently only implemented for hash indices and skiplist indices.
|
||||
|
||||
|
||||
v1.4.5 (XXXX-XX-XX)
|
||||
-------------------
|
||||
|
||||
* added override file "arangod.conf.local" (and co)
|
||||
|
||||
|
||||
v1.4.4 (2013-12-24)
|
||||
-------------------
|
||||
|
||||
|
|
|
@ -279,6 +279,7 @@ void ArangoClient::parse (ProgramOptions& options,
|
|||
|
||||
// parse config file
|
||||
string configFile = "";
|
||||
bool allowLocal = false;
|
||||
|
||||
if (! _configFile.empty()) {
|
||||
if (StringUtils::tolower(_configFile) == string("none")) {
|
||||
|
@ -299,6 +300,7 @@ void ArangoClient::parse (ProgramOptions& options,
|
|||
|
||||
if (FileUtils::exists(sysDir)) {
|
||||
configFile = sysDir;
|
||||
allowLocal = true;
|
||||
}
|
||||
else {
|
||||
LOG_DEBUG("no system init file '%s'", sysDir.c_str());
|
||||
|
@ -307,6 +309,18 @@ void ArangoClient::parse (ProgramOptions& options,
|
|||
}
|
||||
|
||||
if (! configFile.empty()) {
|
||||
if (allowLocal) {
|
||||
string localConfigFile = configFile + ".local";
|
||||
|
||||
if (FileUtils::exists(localConfigFile)) {
|
||||
LOG_DEBUG("using init override file '%s'", localConfigFile.c_str());
|
||||
|
||||
if (! options.parse(description, localConfigFile)) {
|
||||
LOG_FATAL_AND_EXIT("cannot parse config file '%s': %s", localConfigFile.c_str(), options.lastError().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG("using init file '%s'", configFile.c_str());
|
||||
|
||||
if (! options.parse(description, configFile)) {
|
||||
|
|
|
@ -1002,8 +1002,27 @@ bool ApplicationServer::readConfigurationFile () {
|
|||
|
||||
if (d != 0) {
|
||||
string sysDir = string(d) + _systemConfigFile;
|
||||
string localSysDir = sysDir + ".local";
|
||||
|
||||
TRI_FreeString(TRI_CORE_MEM_ZONE, d);
|
||||
|
||||
// check and see if a local override file exists
|
||||
if (FileUtils::exists(localSysDir)) {
|
||||
LOG_INFO("using init override file '%s'", localSysDir.c_str());
|
||||
|
||||
bool ok = _options.parse(_descriptionFile, localSysDir);
|
||||
|
||||
// Observe that this is treated as an error - the configuration file exists
|
||||
// but for some reason can not be parsed. Best to report an error.
|
||||
if (! ok) {
|
||||
LOG_ERROR("cannot parse config file '%s': %s", localSysDir.c_str(), _options.lastError().c_str());
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_TRACE("no system init override file '%s' found", sysDir.c_str());
|
||||
}
|
||||
|
||||
// check and see if file exists
|
||||
if (FileUtils::exists(sysDir)) {
|
||||
LOG_INFO("using init file '%s'", sysDir.c_str());
|
||||
|
@ -1012,7 +1031,6 @@ bool ApplicationServer::readConfigurationFile () {
|
|||
|
||||
// Observe that this is treated as an error - the configuration file exists
|
||||
// but for some reason can not be parsed. Best to report an error.
|
||||
|
||||
if (! ok) {
|
||||
LOG_ERROR("cannot parse config file '%s': %s", sysDir.c_str(), _options.lastError().c_str());
|
||||
}
|
||||
|
|
|
@ -422,14 +422,18 @@ namespace triagens {
|
|||
/// Specifies the name of the configuration file to use.
|
||||
///
|
||||
/// If this command is not passed to the server, then by default, the server
|
||||
/// will attempt to first locate a file named @LIT{~/.arango/arangod.conf} in the
|
||||
/// will attempt to first locate a file named `~/.arango/arangod.conf` in the
|
||||
/// user's home directory.
|
||||
///
|
||||
/// If no such file is found, the server will proceed to look for a file
|
||||
/// @LIT{arangod.conf} in the system configuration directory. The system
|
||||
/// `arangod.conf` in the system configuration directory. The system
|
||||
/// configuration directory is platform-specific, and may be changed when
|
||||
/// compiling ArangoDB yourself. It may default to @LIT{/etc} or
|
||||
/// @LIT{/usr/local/etc}.
|
||||
/// compiling ArangoDB yourself. It may default to `/etc/arangodb` or
|
||||
/// `/usr/local/etc/arangodb`. This file is installed when using a package
|
||||
/// manager like rpm or dpkg. If you modify this file and later upgrade to a new
|
||||
/// version of ArangoDB, then the package manager normally warns you about the
|
||||
/// conflict. In order to avoid these warning for small adjustments, you can put
|
||||
/// local overrides into a file `arangod.conf.local`.
|
||||
///
|
||||
/// Only command line options with a value should be set within the
|
||||
/// configuration file. Command line options which act as flags should be
|
||||
|
|
Loading…
Reference in New Issue