About Unicorn Rack handler

Lin Jen-Shin (aka godfat 真常) godfat at godfat.org
Thu Nov 5 10:13:46 EST 2009

2009/11/5 Eric Wong <normalperson at yhbt.net>:
> As I explained in the other email, this unfortunately can't ever give
> you all the features that Unicorn has.
> I've made an effort to keep everything else as compatible and the
> migration paths as easy as possible.

Many, many thanks for your effort on Unicorn.
It's awesome, in all ways. I would switch all services
at my working place to Unicorn at some point.

> Can you try and see if the USR2 handling of Unicorn allows
> a transparent upgrade here?  If it doesn't then I don't think
> it's worth supporting an interface that's crippled compared
> to using the plain `unicorn' command.

I think it does work. This is start.rb:

#!/usr/bin/env ruby
require File.expand_path('app', File.dirname(__FILE__))
require 'unicorn'
Rack::Handler.register('unicorn', 'Unicorn')
Ramaze.start(:adapter => 'unicorn', :port => 7000)

It won't work if I invoke start.rb like this:
$ ruby start.rb
(perhaps it's impossible to get the `ruby' ?)
but it does work if I invoke this way:
$ ./start.rb
(tested with different debug output in lib/unicorn.rb)

On the other hand, `ramaze' command won't work,
and I guess it's because it uses `rackup', which
you've explained why it won't.

I am wondering.. Could `rackup' be fixed for this?
For instance, use the same way as `unicorn' in `rackup'?
If so, I would be glad to try to fix that in rackup.
I would try it later in my free time.


More information about the mongrel-unicorn mailing list