When I start the MongoDB server (mongod) from terminal it keeps that tab open. How do I go about running it as a service?
I’m on OSX Lion.
I like how the rails server script has a -d option to detach it from terminal.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is built into
mongod, much like it is in the rails server. Instead of-dyou’ll need to use--forkand you’ll probably want to specify--logpath /path-to/logfile --logappendas well, so that your output will be logged and will keep any previous logs.See the docs on starting and stopping Mongo for more information.