New release of SCGI

Hi,

Looking at using the updated scgi gem version. I have a bit of confusion
regarding how to run it. The earlier Zed version(0.4.3) ran without
issue in a lightty configuration I have, pre 2.+ ROR. Updated to 2.1.1
and the scgi_service command fails due to method missing errors which
makes believe .0.4.3 and ROR 2.1.1 are not compatible.

If I upgrade to gem scgi .0.9.0 will it run with ROR 2.1.1?

If so, should the scgi_rails(0.4.3) gem be removed? I tried doing just
that and the scgi_ctrl command was not found.

I am looking for the steps to use the new SCGI gem. Sorry if this is a
bit brain dead, I have tried several combinations without success, any
help is appreciated.

thanks,
Rick

Rick Fiorentino wrote:

Hi,

Looking at using the updated scgi gem version. I have a bit of confusion
regarding how to run it. The earlier Zed version(0.4.3) ran without
issue in a lightty configuration I have, pre 2.+ ROR. Updated to 2.1.1
and the scgi_service command fails due to method missing errors which
makes believe .0.4.3 and ROR 2.1.1 are not compatible.

If I upgrade to gem scgi .0.9.0 will it run with ROR 2.1.1?

If so, should the scgi_rails(0.4.3) gem be removed? I tried doing just
that and the scgi_ctrl command was not found.

I am looking for the steps to use the new SCGI gem. Sorry if this is a
bit brain dead, I have tried several combinations without success, any
help is appreciated.

thanks,
Rick

The command line tool is now called style and it is available in the
ruby-style gem [1] (this is mentioned in the ruby-scgi README). The
reason for this is that the command line tool was generalized to support
multiple frameworks and backends. The ruby-style README has an example
configuration for Rails+SCGI.

[1] http://ruby-style.rubyforge.org/

Jeremy

Thanks Jeremy.

I am up and running on my Linux box per your direction but I noticed
style on windows is not supported due to fork issues? Seems like SCGI on
windows with ROR 2.+ is not an option anymore?

Is there a solution for SCGI on windows with lighttpd and ROR 2.1.1?

Any info is appreciated?

Rick Fiorentino wrote:

Thanks Jeremy.

I am up and running on my Linux box per your direction but I noticed
style on windows is not supported due to fork issues? Seems like SCGI on
windows with ROR 2.+ is not an option anymore?

Is there a solution for SCGI on windows with lighttpd and ROR 2.1.1?

Any info is appreciated?

It may run in debug mode (-D). This doesn't fork or redirect io. You
are limited to running on one port, though. Give that a shot and
post/reply whether or not it works.

Thanks,
Jeremy

Hi Jeremy,
Doesn't appear to work even in debug mode on Windows. Let me know if you
need additional info or if I goofed up the testing.

Error below:

c:/ruby/lib/ruby/gems/1.8/gems/scgi-0.9.0/lib/scgi.rb:257:in `trap':
unsupported signal SIGHUP (ArgumentError)
        from
c:/ruby/lib/ruby/gems/1.8/gems/scgi-0.9.0/lib/scgi.rb:257:in
`setup_signals'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style/handler/scgi.rb:22:in
`initialize'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style/handler/scgi.rb:34:in
`initialize'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style/adapter/rails.rb:26:in
`new'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style/adapter/rails.rb:26:in
`run_rails_scgi'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style/adapter/rails.rb:8:in
`run'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style.rb:105:in
`load_adapter'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style.rb:283:in
`run_child'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style.rb:291:in
`run_in_foreground'
        from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/lib/style.rb:185:in
`process'
        from c:/ruby/lib/ruby/gems/1.8/gems/ruby-style-1.2.1/bin/style:3
        from c:/ruby/bin/style:19:in `load'
        from c:/ruby/bin/style:19

Rick Fiorentino wrote:

Hi Jeremy,
Doesn't appear to work even in debug mode on Windows. Let me know if you
need additional info or if I goofed up the testing.

You didn't goof anything up, it's setting up the signals in scgi that is
the problem. Try this patch to ruby-scgi:

diff --git a/lib/scgi.rb b/lib/scgi.rb
index 8852da2..44200ce 100755
--- a/lib/scgi.rb
+++ b/lib/scgi.rb
@@ -254,8 +254,13 @@ module SCGI
     def setup_signals
       trap("TERM") { @log.info("SIGTERM, forced shutdown.");
shutdown(force=true) }
       trap("INT") { @log.info("SIGINT, graceful shutdown started.");
shutdown }
- trap("HUP") { @log.info("SIGHUP, graceful shutdown started.");
shutdown }
- trap("USR2") { @log.info(status_info) }
+ begin
+ trap("HUP") { @log.info("SIGHUP, graceful shutdown started.");
shutdown }
+ trap("USR2") { @log.info(status_info) }
+ rescue ArgumentError
+ # Probably on Windows and these signals aren't supported
+ nil
+ end
     end

     # Returns a Hash with status information. This is used

If this helps, I'll put out a 0.9.1 ruby-scgi release.

Jeremy

Hi Jeremy,

This appears work however there is no way to cleanly shut down the

style --debug --handler scgi start

control-c's are ignored and the only way to stop this is to shutdown /
close the cmd prompt.

Basically, I am surprised there is not a SIG handler in windows to do
this as well?

If more info is needed please let me know...

Thanks,
Rick