1
0
Fork 0

Make the existance of the database directory non-mandatory again.

This commit is contained in:
Wilfried Goesgens 2016-08-25 10:07:37 +02:00
parent 795daeea13
commit 4939e02fb2
6 changed files with 10 additions and 7 deletions

View File

@ -484,7 +484,7 @@ bool HttpCommTask::processRead() {
LOG(DEBUG) << "connection close requested by client";
_closeRequested = true;
} else if (_requestAsHttp()->isHttp10() && connectionType != "keep-alive") {
// HTTP 1.0 request, and no "Connection: Keep-Alive" header sent
// HTTP 1.0 request, and no "Connection: keep-alive" header sent
// we should close the connection
LOG(DEBUG) << "no keep-alive, connection close requested by client";
_closeRequested = true;

View File

@ -137,7 +137,7 @@ void DatabaseFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
FATAL_ERROR_EXIT();
}
ctx->getCheckPath(_databasePath, "database.directory");
ctx->getCheckPath(_databasePath, "database.directory", false);
if (_maximalJournalSize < TRI_JOURNAL_MINIMAL_SIZE) {
LOG(FATAL) << "invalid value for '--database.maximal-journal-size'. "

View File

@ -155,7 +155,7 @@ void V8DealerFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
FATAL_ERROR_EXIT();
}
ctx->getCheckPath(_startupPath, "javascript.startup-directory");
ctx->getCheckPath(_startupPath, "javascript.startup-directory", true);
_startupLoader.setDirectory(_startupPath);
ServerState::instance()->setJavaScriptPath(_startupPath);
@ -166,7 +166,7 @@ void V8DealerFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
FATAL_ERROR_EXIT();
}
ctx->getCheckPath(_appPath, "javascript.app-directory");
ctx->getCheckPath(_appPath, "javascript.app-directory", true);
// use a minimum of 1 second for GC
if (_gcFrequency < 1) {

View File

@ -817,7 +817,7 @@ void V8ShellFeature::initGlobals() {
FATAL_ERROR_EXIT();
}
ctx->getCheckPath(_startupDirectory, "javascript.startup-directory");
ctx->getCheckPath(_startupDirectory, "javascript.startup-directory", true);
// initialize standard modules
std::string modules =

View File

@ -273,11 +273,14 @@ void ArangoGlobalContext::tempPathAvailable() {
#endif
}
void ArangoGlobalContext::getCheckPath(std::string &path, const char *whichPath) {
void ArangoGlobalContext::getCheckPath(std::string &path, const char *whichPath, bool fatal) {
if (!arangodb::basics::FileUtils::exists(path)) {
std::string directory;
directory = arangodb::basics::FileUtils::buildFilename(_runRoot, path);
if (!arangodb::basics::FileUtils::exists(directory)) {
if (!fatal) {
return;
}
LOG(ERR) << "failed to locate " << whichPath << " directory, its neither available in '" << path << "' nor in '" << directory << "'";
FATAL_ERROR_EXIT();
}

View File

@ -37,7 +37,7 @@ class ArangoGlobalContext {
public:
std::string binaryName() { return _binaryName; }
std::string runRoot() { return _runRoot; }
void getCheckPath(std::string &path, const char *whichPath);
void getCheckPath(std::string &path, const char *whichPath, bool fatal);
int exit(int ret);
void installHup();
void installSegv();