Forum: Mongrel Mongrel as a Windows Service (not running Rails)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eff4944f0c6d77290f7aaffdbeb8bfdb?d=identicon&s=25 Daniel Mantilla (dmantilla)
on 2009-02-19 18:24
Hi, I hope you can help me with this. I have implemented a simple web
app on top of Mongrel and now I need to run it as a Windows Service. I
explored the mongrel_service gem and it looks like I will need an
executable (.exe) for this. Is there a way to use the existing
mongrel_service.exe to run my own script?

Thanks in advance,

Daniel
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2009-02-19 20:14
(Received via mailing list)
On Thu, Feb 19, 2009 at 3:24 PM, Daniel Mantilla <lists@ruby-forum.com>
wrote:
> Hi, I hope you can help me with this. I have implemented a simple web
> app on top of Mongrel and now I need to run it as a Windows Service. I
> explored the mongrel_service gem and it looks like I will need an
> executable (.exe) for this. Is there a way to use the existing
> mongrel_service.exe to run my own script?
>

mongrel_service gem was implemented to work with Rails.

Inside the gem there is mongrel_service.exe (inside bin), but that
only works with mongrel_rails script.

While your user case is a valid one, was not considered when developed.

You have a few options for your situation:

1) check mongrel_service FreeBASIC code (which is the actual service)
and implement your own variation.
(willl take you some time)

2) look into options like svrany or firedaemon, which let you run
console applications as services.

> Thanks in advance,
>

Hope this helps,
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
B19b02a49b433c9e2e6e6c43785d2bfb?d=identicon&s=25 James Tucker (Guest)
on 2009-02-20 14:09
(Received via mailing list)
> You have a few options for your situation:
>
> 1) check mongrel_service FreeBASIC code (which is the actual service)
> and implement your own variation.
> (willl take you some time)
>
> 2) look into options like svrany or firedaemon, which let you run
> console applications as services.

3) http://github.com/raggi/ruby_service_helper/, and I recommend you
also use http://github.com/raggi/rubyw_helper/, these work with win32-
service-0.6.1. If you're on a mingw build of ruby, you may need to gem
install --platform=x86-mswin32-60 win32-service first, as gcc can't
deal with SEH.

The above provides something that's relatively easy to prototype, but
also still mostly debuggable:

http://pastie.textmate.org/private/rsnvpy5eogjhicawttjgra (untested)

HTH
Eff4944f0c6d77290f7aaffdbeb8bfdb?d=identicon&s=25 Daniel Mantilla (dmantilla)
on 2009-02-20 19:31
Thanks guys for your suggestions. I will give them both a shot.

Daniel
This topic is locked and can not be replied to.