0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

clean locking for shutdownServer

This commit is contained in:
Eliot Horowitz 2010-04-05 20:52:05 -04:00
parent b93b91ff8d
commit 06d88881b1

View File

@ -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