2

I was trying to run couchdb with runit, and I encountered the error above. Even this, this and many others didn't help me in knowing what the problem is.

Here was what I did to produce the problem. Runit and couchdb were installed fresh.

I am running CentOS 7.

Step 1: Make sure that couchdb command is correct:

#exec /usr/local/bin/couchdb

Apache CouchDB 1.6.1 (LogLevel=info) is starting.                                                         
Apache CouchDB has started. Time to relax.                                                                
[info] [<0.32.0>] Apache CouchDB has started on http://0.0.0.0:5984/

Step 2: Make a folders. Here is what my folder structure like:

/
|--etc
    |--sv
        |--couchdb
    |--service

Step 3: Inside /etc/sv/, I create a file name run with the following script inside:

#!/bin/sh                                                                                                                                     
exec /usr/local/bin/couchdb

Step 4: Activate it by linking the process directory:

ln -s /etc/sv/couchdb /etc/service/couchdb

Step 5: Try to run it:

#sv start couchdb                                                                
warning: couchdb: unable to open supervise/ok: file does not exist

All the search results point to the same sort of steps that need taking. I followed all the instructions I could find and I got stuck here.

user3622260
  • 131
  • 5
  • Why aren't you using a systemd unit? – Michael Hampton Feb 10 '17 at 22:16
  • I've been trying to work out with systemd unit but there is no clear tutorial on how it works. I had tried many options before I tried runit. – user3622260 Feb 10 '17 at 22:56
  • It's so easy that a tutorial is hardly necessary. Just see the documentation if you run into any trouble. Or start with a systemd unit for couchdb that someone else has already written (such as [this one](https://github.com/CleverCloud/systemd-services/blob/master/couchdb.service)). – Michael Hampton Feb 10 '17 at 22:59

1 Answers1

0

runit needs runit-systemd for CouchDB control

I had exactly the same issue on Debian 10 and - as with a lot of CouchDB setup - the answer isn't easy to find.

However, a post on Ask Ubuntu pointed out that “the runit package does not provide a systemd unit file” —this is provided by runit-systemd, so…

‌sudo aptitude install runit-systemd did the job.

Before:

sudo sv status couchdb
warning: couchdb: unable to open supervise/ok: file does not exist

After:

sudo sv status couchdb
down: couchdb: 0s, normally up, want up; run: log: (pid 24238) 122s
Dave Everitt
  • 181
  • 2
  • 11