Created
May 19, 2013 19:36
-
-
Save robdbirch/5608704 to your computer and use it in GitHub Desktop.
God Mongo Shutdown function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def m_shutdown() | |
m = <<-mongo_shutdown | |
/usr/local/bin/mongo<<-md | |
use admin | |
db.shutdownServer() | |
exit | |
md | |
mongo_shutdown | |
end | |
God.watch do |w| | |
w.group = "middleware" | |
w.name = "mongo" | |
w.start = "/usr/local/bin/mongod --config #{APP_ROOT}/config/mongod.conf" | |
w.stop = m_shutdown | |
w.start_grace = 5.seconds | |
w.restart_grace = 5.seconds | |
w.log = "/usr/local/var/log/mongodb/mongo.log" | |
w.pid_file = "#{APP_ROOT}/run/mongo.pid" | |
w.keepalive | |
w.behavior(:clean_pid_file) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment