Luis Lavena
2006-May-14 16:20 UTC
[Mongrel] Broken win32 service support for lastest mongrels.
Ok, this might sound bad... well, actually it is. I''m my rewrite of mongrel_rails_service and provide a uniform set of commands in the line of gem_plugin commands, found a few issues while stopping the service. Thinking that rails (1.1.2) was responsable, tested against my 1.0.0 rails app, both with the same results. Again, reverted to mongrel 0.3.8, when services was working ok, with the same result (broken pipe during stop of the service). Weird, reverted to a fresh ruby installation (1.8.4, plain, not One-Click Installer), again with the same result. I need someone that could try lastest mongrel_rails_service against any version of rails, with correct start/stop functionality and that could share their setup. My guess is that my current XP is broken and will require revert to lastest image (last december). Until then, any feedback on this matter will be welcome. -- Luis Lavena 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
Zed Shaw
2006-May-14 18:47 UTC
[Mongrel] Broken win32 service support for lastest mongrels.
Hey Luis, I''ll take a look at it today. I have a *fresh* XP install with no Ruby installed on it even. Zed On Sun, 2006-05-14 at 13:20 -0300, Luis Lavena wrote:> Ok, this might sound bad... well, actually it is. > > I''m my rewrite of mongrel_rails_service and provide a uniform set of > commands in the line of gem_plugin commands, found a few issues while > stopping the service. > > Thinking that rails (1.1.2) was responsable, tested against my 1.0.0 > rails app, both with the same results. > > Again, reverted to mongrel 0.3.8, when services was working ok, with > the same result (broken pipe during stop of the service). > > Weird, reverted to a fresh ruby installation (1.8.4, plain, not > One-Click Installer), again with the same result. > > I need someone that could try lastest mongrel_rails_service against > any version of rails, with correct start/stop functionality and that > could share their setup. > > My guess is that my current XP is broken and will require revert to > lastest image (last december). > > Until then, any feedback on this matter will be welcome. >
Luis Lavena
2006-May-15 03:52 UTC
[Mongrel] Broken win32 service support for lastest mongrels.
Thank you Zed, Again, I decide to do this against my health (my fiance will kill me for doing this on Sunday), anyway: * Revert to my last december xp installation image (thank you Acronis!). * Used a clean Ruby 1.8.4 with readline, iconv and zlib compiled locally (no the One Click Installer). These are the gems I installed to test Rails 1.0.0: actionmailer (1.1.5) actionpack (1.11.2) actionwebservice (1.0.0) activerecord (1.13.2) activesupport (1.2.5) mongrel (0.3.8) rails (1.0.0) rake (0.7.1) sources (0.0.1) sqlite3-ruby (1.1.0) win32-service (0.5.0) * Created a empty rails 1.0.0 app name myservice. * Checked it worked with webrick, and mongrel_rails start and got this information from index.html: Ruby version 1.8.4 (i386-mswin32) RubyGems version 0.8.11 Rails version 1.0.0 Active Record version 1.13.2 Action Pack version 1.11.2 Action Web Service version 1.0.0 Action Mailer version 1.1.5 Active Support version 1.2.5 Application root D:/Programming/Sources/myservice Environment development Database adapter sqlite3 So far, that was OK. * Installed ''myservice'' using mongrel_rails_service: mongrel_rails_service -n myservice -e development (force the development environment instead of production as default) * Started the service, after 10 seconds, service was ready, checked and compared with previous output, was ok. * Stopped the service using mongrel_rails_service stop, it stopped just fine. Before I jump into conclusion, done a new start & stop round, this time with a broken pipe error. Conclusion: something don''t work the same way twice. To probe that I was doing something wrong (which most of the times that is correct), I created the simple http_service.rb attached to this message. It only create a Simple Handler and a DirHandler of the local folder, always listening in port 3000. So far, tested against 0.3.8 and 0.3.12.4 of mongrel, functionality was ok (no problem pipe here). I changed a lot of the "concept" on how the services work in this script, so I need help from all the windows users on the list. Please download the script, put in some folder, and run:>ruby http_service.rb install >ruby http_service.rb startBrowse to http://localhost:3000 Check it worked, then stop the service:>ruby http_service.rb stop(please check if it report errors or not). Run with remove command to remove the service from your machine. Reply to this post with your environment:>ruby -v >ver (windows version) Ex: Microsoft Windows XP [Version 5.1.2600]Against which version of Mongrel you tested it. I have found that the lack of locking in the debugging methods causes the broken pipe errors. I''ll find workaround (maybe add logging to eventlog of win32), suggestions are welcome. Thank you guys for the time you spend on this, I really appreciate it. Based on this progress, I''ll rewrite the new mongrel_service script to fix this and will try. Please, anyone with problems, reply this so we could get these fixed in the next release. Later, -- Luis Lavena 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: http_service.rb Type: application/octet-stream Size: 3585 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20060515/7e6fd57e/attachment.obj
Zed Shaw
2006-May-15 05:42 UTC
[Mongrel] Broken win32 service support for lastest mongrels.
Ok, I''ll try this out too. On Mon, 2006-05-15 at 00:52 -0300, Luis Lavena wrote:> Please download the script, put in some folder, and run: > >ruby http_service.rb install > >ruby http_service.rb start > Browse to http://localhost:3000 > Check it worked, then stop the service: > >ruby http_service.rb stop > (please check if it report errors or not). > Run with remove command to remove the service from your machine.One question, if the service stops then what about just not caring about the error? If it doesn''t actually stop the system from functioning, we can probably just ignore it. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/
Luis Lavena
2006-May-15 05:55 UTC
[Mongrel] Broken win32 service support for lastest mongrels.
On 5/15/06, Zed Shaw <zedshaw at zedshaw.com> wrote: [snip]> One question, if the service stops then what about just not caring about > the error? If it doesn''t actually stop the system from functioning, we > can probably just ignore it.The problem is that sometimes... that depends on windows mood. I have seen a few times that after you got the broken pipe error, the offending process (the service) is still running, but don''t answer via http nor any attempts to stop it again. Besides, average users will use the Service Manager to handle the service, which will show error messages (and we didn''t talk about eventlog!). If we could fix it, less reports about that problem will raise in the future and we wil get a better user experience overall... Later, -- Luis Lavena 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
Berger, Daniel
2006-May-15 14:43 UTC
[Mongrel] Broken win32 service support for lastest mongrels.
> -----Original Message----- > From: mongrel-users-bounces at rubyforge.org > [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Luis Lavena > Sent: Sunday, May 14, 2006 11:55 PM > To: mongrel-users at rubyforge.org > Subject: Re: [Mongrel] Broken win32 service support for > lastest mongrels. > > > On 5/15/06, Zed Shaw <zedshaw at zedshaw.com> wrote: > [snip] > > One question, if the service stops then what about just not caring > > about the error? If it doesn''t actually stop the system from > > functioning, we can probably just ignore it. > > The problem is that sometimes... that depends on windows > mood. I have seen a few times that after you got the broken > pipe error, the offending process (the service) is still > running, but don''t answer via http nor any attempts to stop it again. > > Besides, average users will use the Service Manager to handle > the service, which will show error messages (and we didn''t > talk about eventlog!). > > If we could fix it, less reports about that problem will > raise in the future and we wil get a better user experience overall...I''ve forwarded this to the win32utils-devel list to see if anyone has any insight. Oh, and I should mention that I''m working on a pure Ruby version of win32-eventlog. I hope to have it out in the next couple of weeks. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Luis Lavena
2006-May-16 06:13 UTC
[Mongrel] Broken win32 service support for lastest mongrels.
On 5/15/06, Berger, Daniel <Daniel.Berger at qwest.com> wrote:> I''ve forwarded this to the win32utils-devel list to see if anyone has > any insight. >Ok, done a new round of code to pin-point the problem. Attached it http_service2.rb, this file implements a Mongrel::Configurator instead of plain HttpServer. If you check the service_main code, will see that the first version explicit start (run) the server here, but this instead need to call run in the service_init to get it working. Also, there is no need to call @config.stop there, because it never get called. In previous mail I talked about "ghost process" (or orphaned ones, whatever). if you change service_main from: while state == RUNNING sleep 1 end to: @config.join It will start and stop ok, but checking the task manager, a ruby.exe process was left behind, with 3 threads! I tested this with ruby.exe and rubyw.exe What really annoys me is that KirbyBase, which also offer a win32 service, join the drb thread (like @config.join) in the service_main all without problems... Anyway, So far, the code in the attach works ok, on any condition, BUT.... the same setup didn''t work for rails (besides there are some issues with load_plugins). Please try this new script, and reply or mail me personally. I really appreciate the time the list take on helping solve this issue. Regards, -- Luis Lavena 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: http_service2.rb Type: application/octet-stream Size: 3562 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20060516/ee21858f/attachment.obj