1
0
Fork 0

more sanity checks on startup & shutdown

This commit is contained in:
Jan Steemann 2015-01-29 09:40:11 +01:00
parent 0e5866a3fd
commit 39d72b1530
3 changed files with 18 additions and 0 deletions

View File

@ -709,6 +709,11 @@ void ArangoServer::buildApplicationServer () {
LOG_INFO("please use the '--pid-file' option");
LOG_FATAL_AND_EXIT("no pid-file defined, but daemon or supervisor mode was requested");
}
OperationMode::server_operation_mode_e mode = OperationMode::determineMode(_applicationServer->programOptions());
if (mode != OperationMode::MODE_SERVER) {
LOG_FATAL_AND_EXIT("invalid mode. must not specify --console together with --daemon or --supervisor");
}
// make the pid filename absolute
int err = 0;

View File

@ -147,6 +147,7 @@ LogfileManager::LogfileManager (TRI_server_t* server,
_allowWrites(false), // start in read-only mode
_hasFoundLastTick(false),
_inRecovery(true),
_startCalled(false),
_slots(nullptr),
_synchroniserThread(nullptr),
_allocatorThread(nullptr),
@ -388,6 +389,7 @@ bool LogfileManager::open () {
}
opened = true;
_startCalled = true;
int res = runRecovery();
@ -518,6 +520,10 @@ void LogfileManager::close () {
////////////////////////////////////////////////////////////////////////////////
void LogfileManager::stop () {
if (! _startCalled) {
return;
}
if (_shutdown > 0) {
return;
}

View File

@ -1042,6 +1042,13 @@ namespace triagens {
bool _inRecovery;
////////////////////////////////////////////////////////////////////////////////
/// @brief whether or not the logfile manager was properly initialized and
/// started
////////////////////////////////////////////////////////////////////////////////
bool _startCalled;
////////////////////////////////////////////////////////////////////////////////
/// @brief the slots manager
////////////////////////////////////////////////////////////////////////////////