Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1669

Unable to start CouchDB in background through a psuedo-tty



    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • None
    • None


      CouchDB crashes when started as a background process in a psuedo-tty.

      Steps to reproduce:

      On a machine that you can ssh into localhost do:

      ssh -tt localhost "/path/to/couchdb -b"

      When the connection closes, CouchDB will be killed.

      A few things I've discovered while debugging

      When I do

      ssh -tt localhost "~/build-couchdb/build/bin/couchdb -b && sleep 10 && curl localhost:5984"

      The output from the command is:

      Apache CouchDB has started, time to relax.


      Connection to localhost closed.

      The contents or couchdb's stdout file is

      Apache CouchDB 1.2.1 (LogLevel=info) is starting.
      Apache CouchDB has started. Time to relax.
      [info] [<0.32.0>] Apache CouchDB has started on
      [info] [<0.131.0>] - - GET / 200

      The contents of couchdb's stderr is

      heart_beat_kill_pid = 32631
      heart_beat_timeout = 11
      heart: Mon Feb 4 07:31:57 2013: Erlang has closed.
      heart: Mon Feb 4 07:31:58 2013: Executed "/home/ubuntu/build-couchdb/build/bin/couchdb -k" -> 0. Terminating.

      This happens no matter how I start CouchDB: as a service, with the init script, with nohup, or with the command above. I built CouchDB using the build instructions for Ubuntu 12.04 from the wiki and using the build-couchdb project on Github.

      The really odd thing is that this only happens when I start couchdb with `ssh -tt`. If I ssh into localhost and start couchdb in the background, it will continue running after I exit the ssh session.


        Issue Links



              wohali Joan Touzet
              dwwoelfel Daniel Woelfel
              0 Vote for this issue
              4 Start watching this issue