Why isn't my launchctl.plst firing on startup?

Solution 1:

The issue is probably because you don't separate the argument key from the value within ProgramArguments.

Instead of writing it in this way:

<key>ProgramArguments</key>
<array>
    <string>/usr/local/mongo/bin/mongod</string>
    <string>--config=/usr/local/etc/mongod.conf</string>
</array>

You have to write --config and /usr/local/etc/mongod.conf in each discrete line, such as:

<key>ProgramArguments</key>
<array>
    <string>/usr/local/mongo/bin/mongod</string>
    <string>--config</string>
    <string>/usr/local/etc/mongod.conf</string>
</array>

And remember that when you modify your .plist file, you first have to unload it and then load it again in order to activate the launchd.