title: How do I make it so Mongo runs automatically all the time on my Azure server?
body: <p>I have two Azure virtual machines. On one I have a Mongo server, on the other I just have a service I created which listens to Twitters streaming API and filters tweets.</p>
  
  <p>Neither of these two services work unless I manually activate them and keep my console window open. For example, to run Mongo I need to ssh into my virtual machine and type: <code>mongod --config /etc/mongod.conf</code>. This starts the Mongo server successfully, but if at anytime I close my browser the service stops. </p>
  
  <p>I believe the reason this is occurring is because when I login the system is allocating me a process by which I can navigate around the system and perform commands. When I type <code>mongod --config /etc/mongod.conf</code> I believe I am using that process to run Mongo. I am not sure how to make Mongo run without doing this though.</p>
  
  <p>How do I make it so Mongo runs automatically all the time on my Azure server?</p>
  
  <p>EDIT:</p>
  
  <p>I tried running Mongo as a daemon but I receive an error:</p>
  
  <pre><code>$ mongod --fork --logpath /var/log/mongodb.log
  
  &gt;&gt;&gt;about to fork child process, waiting until server is ready for connections.
  &gt;&gt;&gt;forked process: 63470
  &gt;&gt;&gt;ERROR: child process failed, exited with error number 1
  </code></pre>