You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Benoit Chesneau <bc...@gmail.com> on 2010/06/25 17:39:54 UTC

Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

On Fri, Jun 25, 2010 at 5:20 PM, Noah Slater <ns...@tumbolia.org> wrote:
> `couchdb -s` should probably report the URL
>
mmm I read the source well,  it doesn't. It just give the status of
CouchDB : pid + if running or not. Also you can't know the port before
CouchDB is launched if port = 0 which is the way some app are
launching couchdb like desktop-couch.

- Benoit

Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

Posted by Benoit Chesneau <bc...@gmail.com>.
On Fri, Jun 25, 2010 at 7:40 PM, Noah Slater <ns...@tumbolia.org> wrote:
> 1.0 should be relatively stable though. So if we're planning to replace the patch with another patch that works differently, is that a good idea. Or do you think both things could live side by side without any trouble?
>

They could live together, but it may be redundant at the end. Is this a problem

If we have some time I could work on another solution. For now I fail
though to find a way to get final port from couch in the shell script.
The only simple way I see for now is to name the CouchDB node and then
call some specific function with erlang that return the correct
information. The list of nodes could be get via erlang too. But do we
want to name the nodes ? (via -sname or such) .

If we don't name the nodes, there may be a way to do it via os pids,
but I don't know it yet.

- benoit

Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

Posted by Noah Slater <ns...@tumbolia.org>.
1.0 should be relatively stable though. So if we're planning to replace the patch with another patch that works differently, is that a good idea. Or do you think both things could live side by side without any trouble?

On 25 Jun 2010, at 18:20, Benoit Chesneau wrote:

> On Fri, Jun 25, 2010 at 7:02 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>> On Fri, Jun 25, 2010 at 6:36 PM, Noah Slater <ns...@tumbolia.org> wrote:
>>> Anyone used screen?
>>> 
>>> When you do "screen -l" you get a list of running screens.
>>> 
>>> "couchdb -s" could do something similar.
>>> 
>>> You could then do "couchdb -s PID" to get the status of that instance, with URL.
>>> 
>>> Thoughts?
>>> 
>> 
>> That can be done by parsing result of ps I think. Is there a way once
>> we have the pid to get the localstatelibdir  of this pid ? So we could
>> read the uri or such ?
>> 
>> There maybe a way to do it via erlang but I don't know one actually .
>> 
>> if we could do a remote call on one sname we could get the port but we
>> don't set the sname actually.
>> 
>> - benoit
>> 
>> - benoit
>> 
> 
> Anyway couldn't it be done in a future version ? I don't want to
> introduce some extra complexity for a 1.0. Really would like this
> patch appear in 1.0 so it can help to port couchdbdesktop or any
> alternative to others OS.
> 
> - benoit


Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

Posted by Benoit Chesneau <bc...@gmail.com>.
On Fri, Jun 25, 2010 at 7:02 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Fri, Jun 25, 2010 at 6:36 PM, Noah Slater <ns...@tumbolia.org> wrote:
>> Anyone used screen?
>>
>> When you do "screen -l" you get a list of running screens.
>>
>> "couchdb -s" could do something similar.
>>
>> You could then do "couchdb -s PID" to get the status of that instance, with URL.
>>
>> Thoughts?
>>
>
> That can be done by parsing result of ps I think. Is there a way once
> we have the pid to get the localstatelibdir  of this pid ? So we could
> read the uri or such ?
>
> There maybe a way to do it via erlang but I don't know one actually .
>
> if we could do a remote call on one sname we could get the port but we
> don't set the sname actually.
>
> - benoit
>
> - benoit
>

Anyway couldn't it be done in a future version ? I don't want to
introduce some extra complexity for a 1.0. Really would like this
patch appear in 1.0 so it can help to port couchdbdesktop or any
alternative to others OS.

- benoit

Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

Posted by Benoit Chesneau <bc...@gmail.com>.
On Fri, Jun 25, 2010 at 6:36 PM, Noah Slater <ns...@tumbolia.org> wrote:
> Anyone used screen?
>
> When you do "screen -l" you get a list of running screens.
>
> "couchdb -s" could do something similar.
>
> You could then do "couchdb -s PID" to get the status of that instance, with URL.
>
> Thoughts?
>

That can be done by parsing result of ps I think. Is there a way once
we have the pid to get the localstatelibdir  of this pid ? So we could
read the uri or such ?

There maybe a way to do it via erlang but I don't know one actually .

if we could do a remote call on one sname we could get the port but we
don't set the sname actually.

- benoit

- benoit

Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

Posted by Noah Slater <ns...@tumbolia.org>.
Anyone used screen?

When you do "screen -l" you get a list of running screens.

"couchdb -s" could do something similar.

You could then do "couchdb -s PID" to get the status of that instance, with URL.

Thoughts?

On 25 Jun 2010, at 17:35, Randall Leeds wrote:

> On Fri, Jun 25, 2010 at 11:01, Benoit Chesneau <bc...@gmail.com> wrote:
>> On Fri, Jun 25, 2010 at 5:47 PM, Noah Slater <ns...@tumbolia.org> wrote:
>>> No, what I meant is that this patch should add that functionality. Hehe.
>>> 
>> Mmm doable by parsing this file, though it will require to know where
>> the file is, which could be difficult. I wonder how -s works when
>> using the same installed base but with different ini at startup by the
>> way.
> 
> You can make -s work by using different pid files for each instance.
> I'm not sure how to make it know the port.
> 
> -Randall


Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

Posted by Randall Leeds <ra...@gmail.com>.
On Fri, Jun 25, 2010 at 11:01, Benoit Chesneau <bc...@gmail.com> wrote:
> On Fri, Jun 25, 2010 at 5:47 PM, Noah Slater <ns...@tumbolia.org> wrote:
>> No, what I meant is that this patch should add that functionality. Hehe.
>>
> Mmm doable by parsing this file, though it will require to know where
> the file is, which could be difficult. I wonder how -s works when
> using the same installed base but with different ini at startup by the
> way.

You can make -s work by using different pid files for each instance.
I'm not sure how to make it know the port.

-Randall

Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

Posted by Benoit Chesneau <bc...@gmail.com>.
On Fri, Jun 25, 2010 at 5:47 PM, Noah Slater <ns...@tumbolia.org> wrote:
> No, what I meant is that this patch should add that functionality. Hehe.
>
Mmm doable by parsing this file, though it will require to know where
the file is, which could be difficult. I wonder how -s works when
using the same installed base but with different ini at startup by the
way.

I'm not sure it works in this case :) Imo I would keep the simple way.

- benoit

Re: [jira] Updated: (COUCHDB-393) Cannot discover currently running http port if ini file specifies port 0

Posted by Noah Slater <ns...@tumbolia.org>.
No, what I meant is that this patch should add that functionality. Hehe.

On 25 Jun 2010, at 16:39, Benoit Chesneau wrote:

> On Fri, Jun 25, 2010 at 5:20 PM, Noah Slater <ns...@tumbolia.org> wrote:
>> `couchdb -s` should probably report the URL
>> 
> mmm I read the source well,  it doesn't. It just give the status of
> CouchDB : pid + if running or not. Also you can't know the port before
> CouchDB is launched if port = 0 which is the way some app are
> launching couchdb like desktop-couch.
> 
> - Benoit