How to run "mongodb --repair" if it's an Upstart job?

Posted by Wolfram Arnold on Server Fault See other posts from Server Fault or by Wolfram Arnold
Published on 2012-04-01T20:07:50Z Indexed on 2012/04/01 23:32 UTC
Read the original article Hit count: 279

Filed under:

My MongoDB server died. The log says something about an unclean shutdown and an existing mongodb.lock file. It recommends to remove the lock file, then restart the mongodb server with --repair.

However, on my system (Ubuntu 10.10), I've installed MongoDB via an apt-get package, and it's set up as Upstart job. If I run mongodb from the command line, it won't find the data, none of the paths are set correctly. Surely, I could read the man page, try to emulate what Upstart would do, give it all the correct parameters plus --repair but that seems like a lot of trouble. There must be a simpler way, that's not fighting Upstart. What is it?

© Server Fault or respective owner

Related posts about upstart