0

I've installed CouchDB v1.0.4 and I want to monitor it's process with Supervisor (the version installed is 2.1.3). I can start CouchDB just fine with:

$ /usr/bin/couchdb

I have the following basic configuration for it in /etc/supervisord.d:

[program:couchdb]
command=/usr/bin/couchdb

However when I start supervisord it will not start couchdb as expected. The error log in /var/log/supervisor/supervisord.log just confirms that the process exists right after starting:

2014-09-25 13:34:10,990 INFO /var/tmp/supervisor.sock:Medusa (V1.1.1.1) started at Thu Sep 25 13:34:10 2014
        Hostname: <unix domain socket>
        Port:/var/tmp/supervisor.sock
2014-09-25 13:34:11,024 CRIT Running without any HTTP authentication checking
2014-09-25 13:34:11,024 INFO daemonizing the process
2014-09-25 13:34:11,025 INFO supervisord started with pid 8258
2014-09-25 13:34:11,037 INFO spawned: 'couchdb' with pid 8259
2014-09-25 13:34:11,044 INFO exited: couchdb (exit status 1; not expected)
2014-09-25 13:34:11,044 INFO received SIGCLD indicating a child quit
2014-09-25 13:34:12,051 INFO spawned: 'couchdb' with pid 8269
2014-09-25 13:34:12,274 INFO exited: couchdb (exit status 1; not expected)
2014-09-25 13:34:12,274 INFO received SIGCLD indicating a child quit
2014-09-25 13:34:14,299 INFO spawned: 'couchdb' with pid 8297
2014-09-25 13:34:14,300 INFO exited: couchdb (exit status 1; not expected)
2014-09-25 13:34:14,300 INFO received SIGCLD indicating a child quit
2014-09-25 13:34:18,319 INFO spawned: 'couchdb' with pid 8306
2014-09-25 13:34:18,320 INFO exited: couchdb (exit status 1; not expected)
2014-09-25 13:34:18,320 INFO received SIGCLD indicating a child quit
2014-09-25 13:34:19,320 INFO gave up: couchdb entered FATAL state, too many start retries too quickly

I can't really tell why that is, as there are no errors logged in /var/log/couchdb/couch.log (log level for CouchDB is set to debug).

Any help will be greatly appreciated.

Bogdan
  • 103
  • 3
  • Does '/usr/bin/couchdb' from a shell starts as accepted? – deagh Sep 25 '14 at 17:58
  • Yes it does. But I've just noticed it also spawns a new process `/usr/lib64/erlang/erts-5.6.5/bin/beam` along with it. – Bogdan Sep 25 '14 at 18:01
  • Try to add the following lines to your supervisor config for couchdb: environment=HOME=/usr/local/var/lib/couchdb redirect_stderr=true – deagh Sep 25 '14 at 18:03
  • Yep that works. You can add it as an answer and I'll accept it. Thanks a lot. – Bogdan Sep 25 '14 at 18:10

1 Answers1

1

You have to set your environment $HOME for couchdb in your supervisord config

environment=HOME=/usr/local/var/lib/couchdb redirect_stderr=true

deagh
  • 2,019
  • 5
  • 19
  • 19