Troubleshoot launchd/launchctl issue where application won't load I'm trying to load a LaunchAgent in ~/Library/LaunchAgents and although, from command line, it "appears" to load. However, if I try to load it again it says it's "already loaded".

But a process for the application isn't running. ps -e | grep mongo shows nothing (well it shows this grep command).

Anyone know how to troubleshoot these kinds of problems? 

Only thing I can find is in /var/log/system.log:

Feb  9 13:15:26 imac com.apple.launchd.peruser.502[130] (homebrew.mxcl.mongodb): Ignored this key: UserName


I'm assuming it's ignoring the UserName because it's being launched from my User directory: ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist. And as per docs this is to be expected.

I can launch the application just fine from Terminal:

/usr/local/bin/mongod


Here's the LaunchAgent plist:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
  &lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;homebrew.mxcl.mongodb&lt;/string&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;/usr/local/bin/mongod&lt;/string&gt;
    &lt;string&gt;run&lt;/string&gt;
    &lt;string&gt;--config&lt;/string&gt;
    &lt;string&gt;/usr/local/etc/mongod.conf&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;true/&gt;
  &lt;key&gt;KeepAlive&lt;/key&gt;
  &lt;false/&gt;
  &lt;key&gt;UserName&lt;/key&gt;
  &lt;string&gt;meltemi&lt;/string&gt;
  &lt;key&gt;WorkingDirectory&lt;/key&gt;
  &lt;string&gt;/usr/local&lt;/string&gt;
  &lt;key&gt;StandardErrorPath&lt;/key&gt;
  &lt;string&gt;/usr/local/var/log/mongodb/output.log&lt;/string&gt;
  &lt;key&gt;StandardOutPath&lt;/key&gt;
  &lt;string&gt;/usr/local/var/log/mongodb/output.log&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;
Got it solved. Will leave this question here…in case someone else has similar issue…and in hopes that someone can offer some good ideas for troubleshooting launchd/launchctl in the future.

My problem was I didn't have my mongod.conf file in the right place. As per plist directive launchctl (or is it launchd?) was looking for /usr/local/etc/mongod.conf but couldn't find it, so, it "loaded" mongod but the app never actually started...and there were no errors to that effect…that I could find.