Take the 2-minute tour ×

How can I run the CouchDB application bundle binaries as a LaunchDaemon? I can run the binary as a local user but when I run the bundled binary as the couchdb user but I get this error:

sh-3.2$ /Applications/CouchDB\ Server.app/Contents/MacOS/CouchDB\ Server 
iniparser: cannot open /usr/local/var/lib/couchdb/Library/Preferences/couchdb-server.ini
Segmentation fault: 11

It seems like I'm missing a step or there is a permissions issue. I think the local.ini file needs to be modified and couchdb-server.ini gets written at run-time but I'm not sure.

I have successfully installed from homebrew but this is not a good solution for us as we need a packaged installer that can be used offline.

Some debugging data:

sh-3.2$ cat /usr/local/var/lib/couchdb/Library/Preferences/couchdb-server.ini 

database_dir = 
view_index_dir = 
uri_file = 

javascript = bin/couchjs share/couchdb/server/main.js
coffeescript = bin/couchjs share/couchdb/server/main-coffee.js

file = 

title = 1.2.0


sh-3.2$ cat /Applications/CouchDB\ Server.app/Contents/Resources/couchdbx-core/etc/couchdb/local.ini 
; CouchDB Configuration Settings

; overwritten on server upgrade.

;max_document_size = 4294967296 ; bytes
database_dir = /usr/local/var/lib/couchdb

;port = 5984
;bind_address =
; Options for the MochiWeb HTTP server.

;WWW-Authenticate = Basic realm="administrator"

; Uncomment next line to set the configuration modification whitelist. Only
; the whitelist.


; require_valid_user = false
secret = af156a45780111c8ce7581a05cbe4628

;level = debug

; down when CouchDB exits.
;foo = /path/to/command -with args

; the default ssl port CouchDB listens on is 6984
; httpsd = {couch_httpd, start_link, [https]}

;cert_file = /full/path/to/server_cert.pem
;key_file = /full/path/to/server_key.pem
;password = somepassword
; set to true to validate peer certificates
verify_ssl_certificates = false
; Path to file containing PEM encoded CA certificates (trusted
; certificates used for verifying a peer certificate). May be omitted if
; you do not want to verify the peer.
;cacert_file = /full/path/to/cacertf
; The verification fun (optionnal) if not specidied, the default
; verification fun will be used.
;verify_fun = {Module, VerifyFun}
ssl_certificate_max_depth = 1
; example.com:5984 = /database

;example.com = /database/


; changing this.
;admin = mysecretpassword
share|improve this question
But does /usr/local/var/lib/couchdb/Library/Preferences/couchdb-server.ini exist? If not you might try copying it to this path... –  OnaBai Dec 11 '12 at 23:45
Yes, but the problem is that the database_dir variable within gets cleared when I run couchdb. This is why I suspect that the local.ini file needs to be set. /Applications/CouchDB\ Server.app/Contents/Resources/couchdbx-core/etc/couchdb/local.ini has the correct database_dir location set but I'm not sure if this is the correct local.ini file. –  Jake Hertenstein Dec 12 '12 at 13:18
add comment


Your Answer



Browse other questions tagged or ask your own question.