WebFaction
Community site: login faq

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?

asked 05 Oct '12, 19:10

gmaniac
1536
accept rate: 0%


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:

nohup $HOME/webapps/application/mongodb-linux-architecture-version/bin/mongod --auth --dbpath $HOME/webapps/application/data/ --port number &

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

permanent link

answered 05 Oct '12, 20:18

waynek
4254
accept rate: 27%

edited 05 Oct '12, 21:21

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.

(05 Oct '12, 21:09) gmaniac

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.

(05 Oct '12, 21:17) waynek
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×29
×7

question asked: 05 Oct '12, 19:10

question was seen: 5,417 times

last updated: 05 Oct '12, 21:21

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM