SERVER-2833 -- shut down cleanly on OS or Service Controller shutdown event
Added code to log shutdown events from the Windows Service Controller and to respond correctly to those events. Shutdown from the console on logoff or shutdown callbacks (stop ignoring them).
This commit is contained in:
@@ -927,6 +927,15 @@ namespace mongo {
|
||||
catch (...) { }
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
// Windows Service Controller wants to be told when we are down,
|
||||
// so don't call ::exit() yet, or say "really exiting now"
|
||||
//
|
||||
if ( rc == EXIT_WINDOWS_SERVICE_STOP ) {
|
||||
if ( c ) c->shutdown();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
tryToOutputFatal( "dbexit: really exiting now" );
|
||||
if ( c ) c->shutdown();
|
||||
::exit(rc);
|
||||
|
||||
Reference in New Issue
Block a user