LaunchDaemon not recognised

Try the following (one-line command) :

sudo chown -R couchdb:couchdb /opt/local/var/lib/couchdb/ /opt/local/var/log/couchdb/ /opt/local/etc/couchdb/ /opt/local/var/run/couchdb

Then reboot.

If it doesn't work, what version of MacPorts and CouchDB do you have ?


I'm not specifically familiar with CouchDB, but I see a couple of potential problems with your .plist file: first, the HOME value being set is weird -- it should be a specific folder path (i.e. wherever you put the couchdb user's home folder), not ~. Second, I suspect you also need to set the PATH environment variable so CouchDB can find the other optional programs you've installed. So that section of the .plist should look something like this:

<key>EnvironmentVariables</key>
<dict>
    <key>HOME</key>
    <string>/usr/local/var/lib/couchdb</string>
    <key>PATH</key>
    <string>/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin</string>
</dict>

(Note: the above values are guesses based on a little googling -- you may need to adjust them to where your CouchDB user's home is and/or where your add-on binaries folders are.) To load the changed .plist file, use:

sudo launchctl unload /Library/LaunchDaemons/org.apache.couchdb.plist
sudo launchctl load /Library/LaunchDaemons/org.apache.couchdb.plist

If that doesn't solve the problem, there are a couple of places to look for more info about what's going wrong: first, take a look at the system log (/var/log/system.log), either with the Console utility or a command line tool; it'll have any errors that launchd ran into while trying to process the .plist file or start CouchDB. Second, follow Mark's suggestion about changing StandardOutPath and StandardErrorPath to real files, and looking at what shows up there. This isn't needed if everything's configured properly, but can be very useful for finding out what's wrong when there's a problem (and you can switch them back to /dev/null after the problem has been solved).