hoodiehq-archive / node-multicouch

Launch multiple CouchDBs from the same installation.
30 stars 18 forks source link

permissions conflict for /etc/couchdb #11

Closed jmarca closed 11 years ago

jmarca commented 11 years ago

I have a standard CouchDB install on Linux (slackware build script, hacked to use git source)

The CouchDB install instructions, Install.Unix, says to

chmod 0770 /usr/local/etc/couchdb

(In my case that translates to /etc/couchdb)

But of course, this means that as a normal user I cannot see /etc/couchdb config files, so multicouch fails with those lovely Erlang croak messages:

Apache CouchDB has started, time to relax.
{"init terminating in do_boot",{{badmatch,{error,{bad_return,{{couch_app,start,[normal,["/etc/couchdb/default.ini","/etc/couchdb/local.ini"]]},{'EXIT',{{badmatch,{error,{error,enoent}}},[{couch_server_sup,start_server,1,[{file,"couch_server_sup.erl"},{line,56}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,274}]}]}}}}}},[{couch,start,0,[{file,"couch.erl"},{line,18}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}

Might want to add a note to the README saying something like:

If you find that CouchDB does not start, check your permissions on the default configuration files (/etc/couchdb, /usr/local/etc/couchdb, etc). The install script on your platform may have set them such that regular users cannot read or execute them. If so doing sudo chmod -R 0774 /etc/couchdb should fix the permissions and allow multicouch to read the configuration files.

This is also relevant to firing up hoodie, which is how I found the problem. Not sure which repo to open an issue there however. Perhaps in the website/docs repo?

janl commented 11 years ago

thanks, good note!

grrr Linux :/

jmarca commented 11 years ago

Well, I think the problem is with CouchDB docs, not LInux...same thing would happen on a Mac if you set the permissions to 0770, no?

The real problem is I'm following instructions. Real package maintainers like Ubuntu and Gentoo, etc ignore the couchdb Readme and do the right thing...

janl commented 11 years ago

I can’t remember when I’ve last seen a /usr/local/etc that isn’t user-readable. In fact /etc is readable on all systems I casually checked on.

The problem is definitely not with CouchDB, but with node-multicouch expecting that CouchDB’s etc/ files are user-readble.

node-multicouch should bail if it can’t read etc/couchdb/default.ini

jmarca commented 11 years ago

Well, that's why I linked to the couchdb instructions...they explicitly tell you to make the /etc/couchdb directory not readable by regular users, with the chmod 0770 thing.

Should I open an issue on CouchDB?

janl commented 11 years ago

@jmarca sorry, my bad, I didn’t pick up on the instructions being wrong.

the 0770 is obviously bollocks. I fixed it here: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9cf9b53d

Thanks <3

janl commented 11 years ago

Well, this was a quick-shot, -grwx is actually sensible, because CouchDB config files can include security relevant data. Hence the 0.

The fix is to not care about default.ini in node-multicouch at all.