title: Start / Stop MongoDB with Homebrew
body: <p>I am using mac osx 10.10.5</p>
  
  <p>This question has been asked many times before and after following the steps, I notice bizarre behavior. </p>
  
  <p>These are the steps which I have taken</p>
  
  <pre><code>brew tap gapple/services
  brew install mongodb
  </code></pre>
  
  <p>This installs the product and now when I do <code>brew services list</code> I can see mongodb in a stopped state.</p>
  
  <p>When I tried to start the process by <code>brew services start mongodb</code> I get an error </p>
  
  <p>Error: Could not read the plist for <code>mongodb</code>!</p>
  
  <p>OK. I googled a solution</p>
  
  <pre><code>mkdir -p ~/Library/LaunchAgents
  cp /usr/local/Cellar/mongodb/3.0.6/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/
  </code></pre>
  
  <p>Now as soon as the file is copied, when I do <code>brew services list</code> ... the mongo process is automatically running.</p>
  
  <p>Now when I do <code>brew services stop mongodb</code>
  It says</p>
  
  <pre><code>Error: Service `mongodb` not running, wanna start it? Try `brew services start mongodb`
  </code></pre>
  
  <p>Now this is bizarre, because just in the last step it said its running. Now when I do</p>
  
  <p><code>mongodb services list</code> it says that the service is stopped. (so the stop command above did work. Even though it threw an error).</p>
  
  <p>Now if I do</p>
  
  <pre><code>brew services start mongodb
  </code></pre>
  
  <p>It gives error Error: Could not read the plist for <code>mongodb</code>!</p>
  
  <p>Now if I copy the file again</p>
  
  <pre><code>cp /usr/local/Cellar/mongodb/3.0.6/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/
  </code></pre>
  
  <p>The service automatically begins to run.</p>
  
  <p>I find this whole thing really bizarre. All I want is a clean way to start stop the mongo db service. And although there are many threads on this site (and elsewhere) ... they don't work or just have strange behavior.</p>