[Win32utils-devel] FW: [Mongrel] Broken win32 service support for lastest mongrels.

Berger, Daniel Daniel.Berger at qwest.com
Mon May 15 10:42:36 EDT 2006

Hi all,

I've forwarded this from the Mongrel mailing list to see if anyone has
any thoughts.  In summary, Luis is hitting broken pipe errors on
occasion when he tries to stop a service.  In a later email Luis
mentions that simply ignoring them might not always be the best idea,
since sometimes the service seems to no longer respond, even though it
still appears to be running fine.


-----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 9:53 PM
To: mongrel-users at rubyforge.org
Subject: Re: [Mongrel] Broken win32 service support for lastest

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

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

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 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 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.

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.


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

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: http_service.rb
Type: application/octet-stream
Size: 3718 bytes
Desc: http_service.rb
Url : http://rubyforge.org/pipermail/win32utils-devel/attachments/20060515/2c9df5c4/attachment.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT202010.txt
Url: http://rubyforge.org/pipermail/win32utils-devel/attachments/20060515/2c9df5c4/attachment.txt 

More information about the win32utils-devel mailing list