Hey Luis, Just implemented the first cut at a graceful stop setup. It seems to mostly work except for a few hicups here and there which I''ll test out. I''ve tested this under OSX and will test on the other platforms soon. To use it take a look at the examples/simpletest.rb and see how I setup an "INT" handler to call HttpServer.stop. Hopefully this will help with your win32 service shutdown. The bad news is while doing this I found that Timeout doesn''t work so well on OSX. I''ve taken out the timeout functionality but left the option in so that people existing code don''t break. More to come. Zed
Mmm, still the trap of Interrupt need 1 request to stop it. (hitting ctrl-c didn''t stop it, need to refresh a the browser to actually get the "server stopped" line). Anyway, working with mongrel/plugins to create mongrel_rails_service Guess that your refactoring will help more informative requires (mongrel/cgi and mongrel/handlers) Later, Luis On 2/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> Hey Luis, > > Just implemented the first cut at a graceful stop setup. It seems to mostly > work except for a few hicups here and there which I''ll test out. I''ve > tested this under OSX and will test on the other platforms soon. > > To use it take a look at the examples/simpletest.rb and see how I setup an > "INT" handler to call HttpServer.stop. > > Hopefully this will help with your win32 service shutdown. > > The bad news is while doing this I found that Timeout doesn''t work so well > on OSX. I''ve taken out the timeout functionality but left the option in so > that people existing code don''t break. > > More to come. > > Zed > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
Ok, I''ll look into this. Seems to work fine for me under OSX, NetBSD and win32. I''ve actually been using Mongrel this weekend as my development/test server for another project. Works real nice. :-) Let me know when you got something for the rails service and we''ll start working on the release. Talk to you soon. Zed On 2/20/06 11:35 PM, "Luis Lavena" <luislavena at gmail.com> wrote:> Mmm, still the trap of Interrupt need 1 request to stop it. > > (hitting ctrl-c didn''t stop it, need to refresh a the browser to > actually get the "server stopped" line). > > Anyway, working with mongrel/plugins to create mongrel_rails_service > > Guess that your refactoring will help more informative requires > (mongrel/cgi and mongrel/handlers) > > Later, > > Luis > > On 2/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote:
By "win32" you mean "Windows XP" or "Windows 2000"? I been using examples/simpletest.rb to try your modifications (the graceful shutdown and the Interrupt/trap catcher) What didn''t work was the trap catcher, actually it requires you generate a new "hit" (or is named request?) after hitting ctrl-c for the HttpServer actually raise the Interrupt. No page get served before stop, just the incoming connection think that allow raising the exception. With Ctrl-Pause it break/stop execution, but the graful shutdown part never get raised. Will work today in the rails part. Later, Luis On 2/21/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> Ok, I''ll look into this. Seems to work fine for me under OSX, NetBSD and > win32. I''ve actually been using Mongrel this weekend as my development/test > server for another project. Works real nice. :-) > > Let me know when you got something for the rails service and we''ll start > working on the release. > > Talk to you soon. > > Zed > > > On 2/20/06 11:35 PM, "Luis Lavena" <luislavena at gmail.com> wrote: > > > Mmm, still the trap of Interrupt need 1 request to stop it. > > > > (hitting ctrl-c didn''t stop it, need to refresh a the browser to > > actually get the "server stopped" line). > > > > Anyway, working with mongrel/plugins to create mongrel_rails_service > > > > Guess that your refactoring will help more informative requires > > (mongrel/cgi and mongrel/handlers) > > > > Later, > > > > Luis > > > > On 2/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote: > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
OT: btw, where you put mongrel on ruby (or reference it) to have in verison control (in your working copy) and allow you test without installing it as gem? Luis On 2/21/06, Luis Lavena <luislavena at gmail.com> wrote:> By "win32" you mean "Windows XP" or "Windows 2000"? > > I been using examples/simpletest.rb to try your modifications (the > graceful shutdown and the Interrupt/trap catcher) > > What didn''t work was the trap catcher, actually it requires you > generate a new "hit" (or is named request?) after hitting ctrl-c for > the HttpServer actually raise the Interrupt. No page get served before > stop, just the incoming connection think that allow raising the > exception. > > With Ctrl-Pause it break/stop execution, but the graful shutdown part > never get raised. > > Will work today in the rails part. > > Later, > > Luis > > On 2/21/06, Zed Shaw <zedshaw at zedshaw.com> wrote: > > Ok, I''ll look into this. Seems to work fine for me under OSX, NetBSD and > > win32. I''ve actually been using Mongrel this weekend as my development/test > > server for another project. Works real nice. :-) > > > > Let me know when you got something for the rails service and we''ll start > > working on the release. > > > > Talk to you soon. > > > > Zed > > > > > > On 2/20/06 11:35 PM, "Luis Lavena" <luislavena at gmail.com> wrote: > > > > > Mmm, still the trap of Interrupt need 1 request to stop it. > > > > > > (hitting ctrl-c didn''t stop it, need to refresh a the browser to > > > actually get the "server stopped" line). > > > > > > Anyway, working with mongrel/plugins to create mongrel_rails_service > > > > > > Guess that your refactoring will help more informative requires > > > (mongrel/cgi and mongrel/handlers) > > > > > > Later, > > > > > > Luis > > > > > > On 2/20/06, Zed Shaw <zedshaw at zedshaw.com> wrote: > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > >
Yeah, win32 means any windows system (XP, 2000, etc.). I''ll play with it some more. What I do is I just run the commands directly in the source with: ruby -Ilib bin/mongrel_rails start Or ruby -Ilib examples/simpletest.rb localhost 3000 doc/rdoc Is that what you needed? Zed On 2/21/06 8:39 AM, "Luis Lavena" <luislavena at gmail.com> wrote:> OT: > > btw, where you put mongrel on ruby (or reference it) to have in > verison control (in your working copy) and allow you test without > installing it as gem? > > Luis > > On 2/21/06, Luis Lavena <luislavena at gmail.com> wrote: >> By "win32" you mean "Windows XP" or "Windows 2000"? >> >> I been using examples/simpletest.rb to try your modifications (the >> graceful shutdown and the Interrupt/trap catcher) >> >> What didn''t work was the trap catcher, actually it requires you >> generate a new "hit" (or is named request?) after hitting ctrl-c for >> the HttpServer actually raise the Interrupt. No page get served before >> stop, just the incoming connection think that allow raising the >> exception. >> >> With Ctrl-Pause it break/stop execution, but the graful shutdown part >> never get raised. >> >> Will work today in the rails part. >> >> Later, >> >> Luis >>
Yep, thats what I needed :-) What do you think about this command line? mongrel_rails_service install --name=my_rails --display=''My Mongrel powered Rails Service'' --rails_root=d:/My/Rails/App options: --rails_root=current directory, anyway validated checking existance of app, config, db, log, public --environment=production --binding=0.0.0.0 --port=3000 --mime-types=path_to_mime_file Later, the StartCommand need just: mongrel_rails_service start --name=my_rails wanted to look a way to avoid --name requirement and just pass "my_rails" The command with get the display name from windows and show it when starting or stopping, a la "net start/stop" functionality. Later, Luis On 2/21/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> Yeah, win32 means any windows system (XP, 2000, etc.). I''ll play with it > some more. > > What I do is I just run the commands directly in the source with: > > ruby -Ilib bin/mongrel_rails start > > Or > > ruby -Ilib examples/simpletest.rb localhost 3000 doc/rdoc > > Is that what you needed? > > Zed > > > On 2/21/06 8:39 AM, "Luis Lavena" <luislavena at gmail.com> wrote: > > > OT: > > > > btw, where you put mongrel on ruby (or reference it) to have in > > verison control (in your working copy) and allow you test without > > installing it as gem? > > > > Luis > > > > On 2/21/06, Luis Lavena <luislavena at gmail.com> wrote: > >> By "win32" you mean "Windows XP" or "Windows 2000"? > >> > >> I been using examples/simpletest.rb to try your modifications (the > >> graceful shutdown and the Interrupt/trap catcher) > >> > >> What didn''t work was the trap catcher, actually it requires you > >> generate a new "hit" (or is named request?) after hitting ctrl-c for > >> the HttpServer actually raise the Interrupt. No page get served before > >> stop, just the incoming connection think that allow raising the > >> exception. > >> > >> With Ctrl-Pause it break/stop execution, but the graful shutdown part > >> never get raised. > >> > >> Will work today in the rails part. > >> > >> Later, > >> > >> Luis > >> > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
That looks great. I think it''s a start and we can get more feedback from win32 users when it''s out. Can you check that in? Zed On 2/21/06 9:30 AM, "Luis Lavena" <luislavena at gmail.com> wrote:> Yep, thats what I needed :-) > > What do you think about this command line? > > mongrel_rails_service install --name=my_rails --display=''My Mongrel > powered Rails Service'' --rails_root=d:/My/Rails/App > > options: > --rails_root=current directory, anyway validated checking existance of > app, config, db, log, public > --environment=production > --binding=0.0.0.0 > --port=3000 > --mime-types=path_to_mime_file > > Later, the StartCommand need just: > > mongrel_rails_service start --name=my_rails > > wanted to look a way to avoid --name requirement and just pass "my_rails" > > The command with get the display name from windows and show it when > starting or stopping, a la "net start/stop" functionality. > > Later, > > Luis >
Indenting and adding a few comments now, in 30 minutes I guess after playing a bit with it. Zed On 2/21/06, Zed Shaw <zedshaw at zedshaw.com> wrote:> That looks great. I think it''s a start and we can get more feedback from > win32 users when it''s out. > > Can you check that in? > > Zed > > > On 2/21/06 9:30 AM, "Luis Lavena" <luislavena at gmail.com> wrote: > > > Yep, thats what I needed :-) > > > > What do you think about this command line? > > > > mongrel_rails_service install --name=my_rails --display=''My Mongrel > > powered Rails Service'' --rails_root=d:/My/Rails/App > > > > options: > > --rails_root=current directory, anyway validated checking existance of > > app, config, db, log, public > > --environment=production > > --binding=0.0.0.0 > > --port=3000 > > --mime-types=path_to_mime_file > > > > Later, the StartCommand need just: > > > > mongrel_rails_service start --name=my_rails > > > > wanted to look a way to avoid --name requirement and just pass "my_rails" > > > > The command with get the display name from windows and show it when > > starting or stopping, a la "net start/stop" functionality. > > > > Later, > > > > Luis > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >