summaryrefslogtreecommitdiff
path: root/src/mongo/db/mongod_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/mongod_main.cpp')
-rw-r--r--src/mongo/db/mongod_main.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp
index ccb5ce1a404..531b875918c 100644
--- a/src/mongo/db/mongod_main.cpp
+++ b/src/mongo/db/mongod_main.cpp
@@ -89,7 +89,6 @@
#include "mongo/db/index_builds_coordinator_mongod.h"
#include "mongo/db/index_names.h"
#include "mongo/db/initialize_server_global_state.h"
-#include "mongo/db/initialize_snmp.h"
#include "mongo/db/internal_transactions_reap_service.h"
#include "mongo/db/introspect.h"
#include "mongo/db/json.h"
@@ -543,8 +542,6 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) {
startMongoDFTDC();
- initializeSNMP();
-
if (mongodGlobalParams.scriptingEnabled) {
ScriptEngine::setup();
}
@@ -835,6 +832,10 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) {
}
}
+ if (!initialize_server_global_state::writePidFile()) {
+ quickExit(EXIT_FAILURE);
+ }
+
// Startup options are written to the audit log at the end of startup so that cluster server
// parameters are guaranteed to have been initialized from disk at this point.
audit::logStartupOptions(Client::getCurrent(), serverGlobalParams.parsedOpts);
@@ -842,7 +843,7 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) {
serviceContext->notifyStartupComplete();
#ifndef _WIN32
- mongo::signalForkSuccess();
+ initialize_server_global_state::signalForkSuccess();
#else
if (ntservice::shouldStartService()) {
ntservice::reportStatus(SERVICE_RUNNING);
@@ -894,7 +895,7 @@ ExitCode initService() {
MONGO_INITIALIZER_GENERAL(ForkServer, ("EndStartupOptionHandling"), ("default"))
(InitializerContext* context) {
- mongo::forkServerOrDie();
+ initialize_server_global_state::forkServerOrDie();
}
#ifdef __linux__
@@ -1144,10 +1145,7 @@ void setUpObservers(ServiceContext* serviceContext) {
opObserverRegistry->addObserver(
std::make_unique<repl::PrimaryOnlyServiceOpObserver>(serviceContext));
opObserverRegistry->addObserver(std::make_unique<FcvOpObserver>());
-
- if (gFeatureFlagClusterWideConfig.isEnabledAndIgnoreFCV()) {
- opObserverRegistry->addObserver(std::make_unique<ClusterServerParameterOpObserver>());
- }
+ opObserverRegistry->addObserver(std::make_unique<ClusterServerParameterOpObserver>());
setupFreeMonitoringOpObserver(opObserverRegistry.get());
@@ -1542,7 +1540,7 @@ int mongod_main(int argc, char* argv[]) {
startupConfigActions(std::vector<std::string>(argv, argv + argc));
cmdline_utils::censorArgvArray(argc, argv);
- if (!initializeServerGlobalState(service))
+ if (!initialize_server_global_state::checkSocketPath())
quickExit(EXIT_FAILURE);
// There is no single-threaded guarantee beyond this point.
@@ -1550,7 +1548,7 @@ int mongod_main(int argc, char* argv[]) {
LOGV2(5945603, "Multi threading initialized");
// Per SERVER-7434, startSignalProcessingThread must run after any forks (i.e.
- // initializeServerGlobalState) and before the creation of any other threads
+ // initialize_server_global_state::forkServerOrDie) and before the creation of any other threads
startSignalProcessingThread();
ReadWriteConcernDefaults::create(service, readWriteConcernDefaultsCacheLookupMongoD);