From 06d88881b1f0c3ffb61d25aad329d07eef74e9d9 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 5 Apr 2010 20:52:05 -0400 Subject: [PATCH] clean locking for shutdownServer --- db/dbcommands.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp index 79288501c8c..9d5ebb49b39 100644 --- a/db/dbcommands.cpp +++ b/db/dbcommands.cpp @@ -57,12 +57,13 @@ namespace mongo { virtual bool slaveOk() { return true; } - virtual LockType locktype(){ return WRITE; } + virtual LockType locktype(){ return NONE; } virtual void help( stringstream& help ) const { help << "shutdown the database. must be ran against admin db and either (1) ran from localhost or (2) authenticated.\n"; } CmdShutdown() : Command("shutdown") {} bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) { + dblock l; cc().shutdown(); log() << "terminating, shutdown command received" << endl; dbexit( EXIT_CLEAN ); // this never returns