CouchDB now supports starting external processes. The support is simple and enables CouchDB to start each configured OS daemon. If the daemon stops at any point, CouchDB will restart it (with protection to ensure regularly failing daemons are not repeatedly restarted).
The daemon starting process is one-to-one; for each each
configured daemon in the configuration file, CouchDB will start
exactly one instance. If you need to run multiple instances, then
you must create separate individual configurations. Daemons are
configured within the [os_daemons]
section of
your configuration file (local.ini
). The
format of each configured daemon is:
NAME = PATH ARGS
Where NAME
is an arbitrary (and unique) name to
identify the daemon; PATH
is the full path to
the daemon to be executed; ARGS
are any
required arguments to the daemon.
For example:
[os_daemons] basic_responder = /usr/local/bin/responsder.js
There is no interactivity between CouchDB and the running process, but you can use the OS Daemons service to create new HTTP servers and responders and then use the new proxy service to redirect requests and output to the CouchDB managed service. For more information on proxying, see Section 2.2, “HTTP Proxying”. For further background on the OS Daemon service, see CouchDB Externals API