Re: [mongrel2] How to set control_port
- From:
- Dalton Barreto
- Date:
- 2011-08-08 @ 19:29
2011/8/8 Jim Fulton <jim@zope.com>:
> On Mon, Aug 8, 2011 at 2:43 PM, Dalton Barreto <daltonmatos@gmail.com> wrote:
>> 2011/8/8 Jim Fulton <jim@zope.com>:
>>> Are there any examples for setting a control_port?
>>>
>>> I've tried setting it several ways, including:
>>>
>>> - Server option
>>> - Host option
>>> - top level option in config file
>>>
>>> To no avail.
>>>
>>> I've also noticed that I can add arbitrary options
>>> without any error from the parser, which makes debugging this
>>> extra challenging.
>>>
>>
>>
>> Did you mean changing the address of the control port from
>> "ipc://run/control" to another value?
>
> Yes.
>
>> If yes, I think this is not yet possible since this value is currently
>> had coded, see
https://github.com/zedshaw/mongrel2/blob/master/src/control.c#L391
>
> Well, in the 1.7.5 release, a few lines below that, there's:
>
> bstring spec = Setting_get_str("control_port", &DEFAULT_CONTROL_SPEC);
>
> It appears that the value set in line 391 is a default and that the
> configuration machinery is trying to get a value from somewhere. :)
>
> Also, the documentation menions this option:
>
> http://mongrel2.org/static/mongrel2-manual.html#x1-380003.8
>
> But doesn't say where to set it, nor does it give an example.
>
Indeed this is strange. According to the manual, this value would be
in the "setting" table, but according to the code
the "control_port" (during the control port set up) setting is never
read. Here [1] the code loads all the settings and for each line
returned by the query it calls
Settings_add [2]. This builds SETTINGS_MAP, containing all settings.
But the code that prepares the control port does not look at the
SETTINGS_MAP to get the right value.
This is indeed confusing. I still think that there is not possible do
change this value, even the manual saying that it is.
What are you trying to do? Maybe there is another way to acomplish
without changing this value, at least while we can't do this with a
configuration.
[1] https://github.com/zedshaw/mongrel2/blob/develop/src/config/config.c#L404
[2] https://github.com/zedshaw/mongrel2/blob/develop/src/setting.c#L42
p.s. I was looking at the master branch, but anyway the code is the
same on the develop branch. I'm now looking at the develop branch.
--
Dalton Barreto
http://daltonmatos.wordpress.com
http://wsgid.com
Re: [mongrel2] How to set control_port
- From:
- Jim Fulton
- Date:
- 2011-08-08 @ 19:46
On Mon, Aug 8, 2011 at 3:29 PM, Dalton Barreto <daltonmatos@gmail.com> wrote:
...
> What are you trying to do?
I just like to have control over where files go. :)
I'm using an automated tool (zc.buildout) to lay out my environment
and it's simpler to create a flat support directory. I can certainly
automate also creating a 'run' subdirectory, but I'd rather not need to.
> Maybe there is another way to acomplish
> without changing this value, at least while we can't do this with a
> configuration.
I can certainly work around this.
Jim
--
Jim Fulton
http://www.linkedin.com/in/jimfulton