Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 83275 invoked from network); 25 Jun 2010 15:20:54 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Jun 2010 15:20:54 -0000 Received: (qmail 81546 invoked by uid 500); 25 Jun 2010 15:20:53 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 81496 invoked by uid 500); 25 Jun 2010 15:20:53 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 81488 invoked by uid 99); 25 Jun 2010 15:20:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 15:20:53 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [72.14.220.158] (HELO fg-out-1718.google.com) (72.14.220.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 15:20:44 +0000 Received: by fg-out-1718.google.com with SMTP id 22so2345165fge.5 for ; Fri, 25 Jun 2010 08:20:23 -0700 (PDT) Received: by 10.102.12.17 with SMTP id 17mr252580mul.36.1277479223483; Fri, 25 Jun 2010 08:20:23 -0700 (PDT) Received: from [192.168.2.4] ([91.110.48.45]) by mx.google.com with ESMTPS id y37sm13893427mug.22.2010.06.25.08.20.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 25 Jun 2010 08:20:23 -0700 (PDT) Subject: Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Noah Slater In-Reply-To: <8294820.59751277478532199.JavaMail.jira@thor> X-Noah: Awesome Date: Fri, 25 Jun 2010 16:20:21 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <1E86775F-35FB-4CC2-8856-E0C603E36689@tumbolia.org> References: <8294820.59751277478532199.JavaMail.jira@thor> To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org `couchdb -s` should probably report the URL On 25 Jun 2010, at 16:08, Benoit Chesneau (JIRA) wrote: >=20 > [ = https://issues.apache.org/jira/browse/COUCHDB-393?page=3Dcom.atlassian.jir= a.plugin.system.issuetabpanels:all-tabpanel ] >=20 > Benoit Chesneau updated COUCHDB-393: > ------------------------------------ >=20 > Attachment: couch_uri.patch >=20 > Here is the patch. It take couch.uri path from the configuration file = . by default it's in %localstatelibdir%/couch.uri . >=20 > It save the uti http://IP:PORT/ on one line when couchdb start. If = it's ok for you I will be happy to commit it today. >=20 >> Cannot discover currently running http port if ini file specifies = port 0 >> = ------------------------------------------------------------------------ >>=20 >> Key: COUCHDB-393 >> URL: https://issues.apache.org/jira/browse/COUCHDB-393 >> Project: CouchDB >> Issue Type: Improvement >> Components: HTTP Interface >> Affects Versions: 0.9 >> Environment: Ubuntu 9.04 >> Reporter: Stuart Langridge >> Assignee: Noah Slater >> Priority: Blocker >> Fix For: 0.12 >>=20 >> Attachments: couch_uri.patch, couchctl.patch >>=20 >>=20 >> It is currently not possible, if the ini file specifies port 0 as the = http port (so that the OS chooses a random port) to discover which port = the OS actually chose. >> It would be nice if the currently running port was made available in = the statusline output (couchdb -s), but a log statement would be = adequate; some way that an external script can discover which port a = running CouchDB is listening on. >> Edited discussion from #couchdb: >> aquarius: well at a glance it appears couch_http passes = the 0 to mochiweb_http which passes it to the mochiweb_socket_server, = which passes it to gen_tcp, an erlang module that lets the underlying OS = assign it. mochiweb_socket_server then grabs that port and stores it. It = has a get method to retrieve properties but that needs to be exposed to = mochiweb_http so it would take a little work to do it. It's probably a = JIRA ticket, unless someone else sees a quicker approach >> bitdiddle: you got that far and didn't find it? >> davisp: is there a better way to find the port? >> oh, is that not the bind port? >> I was just thinking a log statement >> davisp: the problem is if you specify 0 as the bind port = (so the OS chooses a port), how do you find out what was chosen? >> aquarius: you have to look at the port returned by the = socket >> aquarius: in other words, CouchDB was never written to do that >> AFAIK >> davisp: I found it, just needs some work to expose it >> aquarius: and by do that, I mean, we never put in a = statement to log that >> mochiweb_http is the module that needs to bubble it up >> davisp: I don't really mind whether it's a log statement = or it's exposed to couchdb -s (the latter seems tidier to me, but = whichever), I just want to be able to start couch on port 0 and then = later find out which port got chosen :) >> aquarius: for the time being you can use something like = netstat or lsof, but we'll get a log statement in there or something >=20 > --=20 > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. >=20