mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
clean locking for shutdownServer
This commit is contained in:
parent
b93b91ff8d
commit
06d88881b1
@ -57,12 +57,13 @@ namespace mongo {
|
|||||||
virtual bool slaveOk() {
|
virtual bool slaveOk() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
virtual LockType locktype(){ return WRITE; }
|
virtual LockType locktype(){ return NONE; }
|
||||||
virtual void help( stringstream& help ) const {
|
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";
|
help << "shutdown the database. must be ran against admin db and either (1) ran from localhost or (2) authenticated.\n";
|
||||||
}
|
}
|
||||||
CmdShutdown() : Command("shutdown") {}
|
CmdShutdown() : Command("shutdown") {}
|
||||||
bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
|
bool run(const char *ns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
|
||||||
|
dblock l;
|
||||||
cc().shutdown();
|
cc().shutdown();
|
||||||
log() << "terminating, shutdown command received" << endl;
|
log() << "terminating, shutdown command received" << endl;
|
||||||
dbexit( EXIT_CLEAN ); // this never returns
|
dbexit( EXIT_CLEAN ); // this never returns
|
||||||
|
Loading…
Reference in New Issue
Block a user