Mongrel 1.0.3

Hello!

/usr/local/bin/ruby18 /usr/local/bin/mongrel_rails start -d -e

development -a 10.164.28.7 -c /var/www/data/site/ --user root --group
wheel -p 8080 -P log/mongrel.8080.pid -l log/mongrel.8080.log

Mongrel 1.0.1:

** Starting Mongrel listening at 10.164.28.7:8080
^^^^^^^^^^^^^^^^
** Changing group to wheel.
** Changing user to root.
** Starting Rails with development environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no
restart).
** Rails signals registered. HUP => reload (without restart). It might
not work well.
** Mongrel available at 10.164.28.7:8080
** Writing PID file to log/mongrel.8080.pid

Mongrel 1.0.3:

** Starting Mongrel listening at :8080
^^^^^ ???
** Starting Rails with development environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no
restart).
** Rails signals registered. HUP => reload (without restart). It might
not work well.
** Mongrel available at 10.164.28.7:8080
** Writing PID file to log/mongrel.8080.pid


WBR

On 10/27/07, Alexander L. [email protected] wrote:

** Starting Rails with development environment…
^^^^^ ???
** Starting Rails with development environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
** Rails signals registered. HUP => reload (without restart). It might not work well.
** Mongrel available at 10.164.28.7:8080
** Writing PID file to log/mongrel.8080.pid

It seems is not handling the IP binding…

Could you try the following in a IRB console?

require ‘rubygems’
require ‘mongrel’
s = Mongrel::HttpServer.new(“127.0.0.1”, 8081)
puts “Host: #{s.host}, Port: #{s.port}”

It’s using a TCPServer inside, so it should work, unless mongrel_rails
is doing something else with the address (host) passed by.


Luis L.
Multimedia systems

Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi

On 10/27/07, Luis L. [email protected] wrote:

It’s using a TCPServer inside, so it should work, unless mongrel_rails
is doing something else with the address (host) passed by.

Also, you indicate was using FreeBSD, there is a exception for HTTP
handling in Mongrel::HttpServer#configure_socket_options

Maybe that is affecting the result? wasn’t present in 1.0.1 AFAIK.


Luis L.
Multimedia systems

Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi

Regarding the listening port, there was a bug in bin/mongrel_rails. I
fixed it in trunk, and I’ll backport it to 1.0.4 in a day or so,
giving time for more bugs to come in. Patch is below.

Also, you indicate was using FreeBSD, there is a exception for HTTP
handling in Mongrel::HttpServer#configure_socket_options

I think is the correct triage for the IP6 bug. Not having FreeBSD,
maybe someone else can figure what it’s supposed to be?

Not many people were using the RC’s except the team; in the future
we’ll just continue to push point releases.

Evan


Index: bin/mongrel_rails

— bin/mongrel_rails (revision 806)
+++ bin/mongrel_rails (revision 807)
@@ -174,15 +178,14 @@

 def config_keys
   @config_keys ||=
  •    %w(host port cwd log_file pid_file environment docroot
    

mime_map daemon debug includes config_script

  •       num_processors timeout throttle user group prefix)
    
  •    %w(address host port cwd log_file pid_file environment
    

docroot mime_map daemon debug includes config_script num_processors
timeout throttle user group prefix)
end

 def settings
   config_keys.inject({}) do |hash, key|
     value = self.instance_variable_get("@#{key}")
     key = 'host' if key == 'address'
  •    hash[key.to_sym] = value
    
  •    hash[key.to_sym] ||= value
       hash
     end
    
    end

The FreeBSD code is as so:

  when /freebsd/
    # Use the HTTP accept filter if available.
    # The struct made by pack() is defined in

/usr/include/sys/socket.h as accept_filter_arg
unless /sbin/sysctl -nq net.inet.accf.http.empty?
$tcp_defer_accept_opts = [Socket::SOL_SOCKET,
Socket::SO_ACCEPTFILTER, [‘httpready’, nil].pack(‘a16a240’)]
end

Something there must be IP6 specific.

Evan

Hello.

Regarding the listening port, there was a bug in bin/mongrel_rails. I
fixed it in trunk, and I’ll backport it to 1.0.4 in a day or so,
giving time for more bugs to come in. Patch is below.
It works, thanks! BTW:

mongrel_rails --version

Mongrel Web Server 1.0.2
^^^^^

Also, you indicate was using FreeBSD, there is a exception for HTTP
handling in Mongrel::HttpServer#configure_socket_options
I think is the correct triage for the IP6 bug. Not having FreeBSD,
maybe someone else can figure what it’s supposed to be?
I’ll watch on this today.


WBR

Yeah, the version string was hardcoded here and there, which I missed.
We’ll fix this for 1.1, possibly for 1.0.4.

Thanks

Evan

Hello, Luis.

** Starting Rails with development environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
** Rails signals registered. HUP => reload (without restart). It might not work well.
** Mongrel available at 10.164.28.7:8080
** Writing PID file to log/mongrel.8080.pid
It seems is not handling the IP binding…
Could you try the following in a IRB console?

require ‘rubygems’
require ‘mongrel’
s = Mongrel::HttpServer.new(“127.0.0.1”, 8081)
puts “Host: #{s.host}, Port: #{s.port}”

It’s using a TCPServer inside, so it should work, unless mongrel_rails
is doing something else with the address (host) passed by.

Here is:

require ‘rubygems’
=> []

require ‘mongrel’
=> []

s = Mongrel::HttpServer.new(“127.0.0.1”, 8081)
=> #<Mongrel::HttpServer:0x2a0ddad4 @num_processors=1073741823,
@timeout=0, @socket=#TCPServer:0x2a0dd9d0, @port=8081,
@workers=#ThreadGroup:0x2a0dd980, @classifier={}, @host=“127.0.0.1”,
@death_time=60>

puts “Host: #{s.host}, Port: #{s.port}”
Host: 127.0.0.1, Port: 8081
=> nil


WBR