title: Mongo refusing connections after system shut it down for RAM outage
body: <p>according to kern.log, system killed mongo due to having no more RAM available (server has 8GB)</p>
  
  <pre><code>Mar 15 18:06:21 ns504049 kernel: Out of memory: Kill process 10532 (mongod) score 0 or sacrifice child
  Mar 15 18:06:21 ns504049 kernel: Killed process 10532 (mongod) total-vm:2556716kB, anon-rss:26968kB, file-rss:0kB
  </code></pre>
  
  <p>It also killed my screen process.</p>
  
  <p>Now <code>mongod service start</code> will work, but mongo will get <code>errno:111 Connection refused</code></p>
  
  <p>i had <code>mongod.lock</code> in both data/db/ and var/lib/mongodb, removed both and issued <code>mongod --repair</code> every time, it claimed success but I'm still getting the same error when trying to connect .</p>
  
  <p>Since i tought it may be that the old process using the <code>27017</code> port i tried to do <code>mongod --shutdown</code> but it will output:    </p>
  
  <pre><code>There doesn't seem to be a server running with dbpath: /data/db
  </code></pre>
  
  <p>but my mongod.conf has <code>dbpath=/var/lib/mongodb</code>...</p>
  
  <p>I even tried:</p>
  
  <pre><code>$sudo service mongod start
  mongod start/running, process 17958
  $service mongod status
  mongod stop/waiting
  $mongod --shutdown
  There doesn't seem to be a server running with dbpath: /data/db
  </code></pre>
  
  <p>why is it looking for that <code>dbpath</code> ?</p>
  
  <p>note: i'm running everything as root
  The only way i manged to at least look into the db is using <code>mongod --dbpath=/var/lib/mongodb</code> in a <code>byobu</code> window and opening <code>mongo</code> console in another</p>