title: How to get custom couchdb to run as upstart job?
body: <p>I built a recent version of CouchDB with the excellent <a href="https://github.com/iriscouch/build-couchdb" rel="nofollow">iriscouch/build-couchdb repo</a>, and now I want to create an upstart job on my Ubuntu 12.04 server.</p>
  
  <p>However, the upstart job fails with:</p>
  
  <pre><code>kernel: [265024.963594] init: couchdb_a main process (5341) terminated with status 1
  </code></pre>
  
  <p>The upstart conf file (/etc/init/couchdb_a.conf):</p>
  
  <pre><code>description     "CouchDB v1.2.0"
  console output
  
  start on (local-filesystems and net-device-up IFACE!=lo)
  stop on runlevel [!2345]
  
  pre-start script
    logger -t "$0" "pre-start"
    export PATH="/path/to/build-couchdb/build/bin:$PATH"
    logger -t "$0" "DEBUG (pre-start): `set`"
  end script
  
  exec /path/to/build-couchdb/build/bin/couchdb 
  </code></pre>
  
  <p>From what I can tell, the custom couchdb simply needs its PATH adjusted to the location of the couchdb binary (that's what iriscouch's env.sh does).</p>
  
  <p>But whether I update the PATH or not, the custom couchdb will not launch in this upstart job (it works perfectly from a shell).</p>