On 17 Jun 2010, at 01:07, Randall Leeds wrote: > On Wed, Jun 16, 2010 at 16:52, Noah Slater <nsla...@tumbolia.org> wrote: >> >> On 16 Jun 2010, at 23:59, Randall Leeds wrote: >> >>> I'd really like to sort out the situation with resource limits. >>> >>> My patch to allow setting a larger mochiweb connection limit was >>> committed (COUCHDB-705), but currently there's no easy user story for >>> increasing things like ERL_MAX_PORTS. I'd also be nice if we could >>> allow people to pass arbitrary flags to the vm. For example, I only >>> recently discovered how nice the +A option is. Unfortunately, the >>> solution I have in production to avoid clobbering the init script is >>> to have the couchdb user use bash as a login shell and export >>> ERL_MAX_PORTS and ERL_ZFLAGS in .bash_profile. I think this is a >>> really hackish thing to do to a daemon. >> >> Why can't we just use /etc/defaults/couchdb for this? > > We can. Currently the init script sources that and passes the relevant > options directly. I'd be +1 on having the init script call couch much > more blindly and let /usr/bin/couchdb deal with sourcing the defaults. > This would obviate the need for passing arguments to erlang because > ERL_(A|Z)?FLAGS could be used instead. > I can write this if you don't have time, but your sh-fu is probably > better than mine.
-1 on that. The /etc/defaults/couchdb file is specifically for the init system. You can pass arbitrary flags to Erlang using the ERL_FLAGS environment variable. The script takes special care to make sure that Erlang shares its environment. If you have a specific set of flags you wish to call as standard, and you don't wish to use the init.d system, then I would advise that you create a wrapper script for your particular use case.