|
I followed the instructions on http://docs.webfaction.com/software/mongodb.html and the mongodb service stops after the ssh window is closed. How do I get it to continue running after the ssh connection is closed? |
|
If you launch it with an ampersand on the end of the line then it will launch as a background process, e.g. using the example from the docs:
You could set up a cron job to ensure it's running every so often, which will then serve a double purpose of ensuring it's running and launch it initially (or launch it manually initially then set up a cron job). You can find information on using cron on WebFaction at the following link (which also contains a link for more advanced cron help): http://docs.webfaction.com/software/general.html#scheduling-tasks-with-cron Thank you for responding so quickly, but that didn't work appending & at the end. The services ends once I close the SSH connection. I have not tried setting up a Cron job yet. It might take me a little while, I am not sure how to set that up yet. Do you have an example of how to setup Cron for running/starting MongoDB every so often? Oh and I would like to thank you for using examples in your post it really helps me. Sorry, I left out something at the beginning. You will need to run it through the "nohup" command so that processes started during the session don't receive a SIGHUP signal when the session closes. I will edit the answer also to include documentation for cron. |