1

I want to automatically start and stop the mongodb server on my development machine which runs Mac OS X. Usually I just add a plist file to ~/Library/LaunchAgents and everything works.

However, I noticed there is a strong warning in the mongodb docs not to use a SIGTERM signal to shutdown the service - presumably this is to allow it to shut down properly: http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/#use-kill

The problem I see is that Mac OS X's launchd system uses a SIGTERM to shut services down that it has started: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html

There are numerous examples on this site and across the web that simply tell you to use a launchd plist file. None of these examples address the SIGTERM issue. ( What is the correct way to start a mongod service on linux / OS X? , How to stop mongo DB in one command , http://wiki.summercode.com/how_to_install_mongodb_on_mac_os_x, etc).

Should I be concerned about using launchd and SIGTERM to shutdown mongodb? Am I going to reboot my machine and find a corrupted database in the near future?

Community
  • 1
  • 1
twktue
  • 71
  • 1
  • 6

0 Answers0