[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Ruby scripts as Win32-Service

Patrick Hurley

2/18/2006 3:36:00 AM

On 2/17/06, William Ramirez <mercan01@gmail.com> wrote:
> I've through together a ruby script as test for a monitoring app for a few
> Win32 user processes I'm stuck with supporting. I've gotten most of the
> management setup, however, I'm stuck trying to figure out how to run the
> script as a service. I tried creating the service manually with
> sc.exe<http://support.microsoft.com/?kbid=...,
> with both the script and a call to c:\ruby\bin\rubyw.exe with the filename
> as the argument, but I receive a time-out. I spent some time with google,
> but perhaps I'm missing something silly?
>
> Does win32-service do something special when creating a service that I'm
> missing with the manual service creation? I suppose I could always run it
> via the startup folder, but I thought this would be cleaner.
>
> Thanks,
>
> William Ramirez
>
>

You did "install" the service using win3-service right? (just asking)

pth


5 Answers

William Ramirez

2/18/2006 3:59:00 AM

0

On 2/17/06, Patrick Hurley <phurley@gmail.com> wrote:
>
>
> You did "install" the service using win3-service right? (just asking)
>
>

Nope, I used the command sc.exe, which allows you to create services. I
didn't see the need to create an 'installer' just for testing purposes. I
browsed the win32-service documentation and it didn't appear to do anything
special with regards to service creation.

Austin Ziegler

2/18/2006 4:12:00 AM

0

On 2/17/06, William Ramirez <mercan01@gmail.com> wrote:> On 2/17/06, Patrick Hurley <phurley@gmail.com> wrote:> > You did "install" the service using win3-service right? (just asking)> Nope, I used the command sc.exe, which allows you to create services. I> didn't see the need to create an 'installer' just for testing purposes. I> browsed the win32-service documentation and it didn't appear to do anything> special with regards to service creation.It's not a traditional installer; it's registering the service. Lookat what Ruwiki does for service management in its command-line.-austin--Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca

Peter Krantz

2/18/2006 7:26:00 AM

0

>Does win32-service do something special when creating a service that I'm
>missing with the manual service creation? I suppose I could always run it
>via the startup folder, but I thought this would be cleaner.

Check out the instiki instructions for running a ruby script as a
windows service:

http://instiki.org/show/Running+as+a+Windo...

Regards,

Peter
-------------------------------------------------
http://www.peterk...
http://www.standards-schman...


Xavier Noria

2/18/2006 8:38:00 AM

0

On Feb 18, 2006, at 8:25, Peter Krantz wrote:

>> Does win32-service do something special when creating a service
>> that I'm
>> missing with the manual service creation? I suppose I could always
>> run it
>> via the startup folder, but I thought this would be cleaner.
>
> Check out the instiki instructions for running a ruby script as a
> windows service:
>
> http://instiki.org/show/Running+as+a+Windo...

Hey I know practically nothing about Windows. Could I follow those
instructions to have WEBrick always running an easily deploy a simple
management Rails tool for internal usage?

-- fxn



Jeremy Henty

2/18/2006 8:55:00 AM

0

On 2006-02-18, Patrick Hurley <phurley@gmail.com> wrote:
> On 2/17/06, William Ramirez <mercan01@gmail.com> wrote:
>> ... I'm stuck trying to figure out how to run the script as a
>> service.

I did this at $WORK a while back (with ActivePerl rather than Ruby).
I used SRVANY.EXE (from the Windows NT Resource Kit), which is a
wrapper that turns any executable into a Windows service. You
register SRVANY.EXE as the service, then create Registry keys to tell
it which program to run (RUBY.EXE, I guess), what arguments to give it
(-w my_script.rb) and what directory to run it in. I'm not at work
right now so I'm short of details but IIRC it was quite
straightforward. Googling for SRVANY.EXE turns up
<URL:http://www.liutilities.com/products/wintaskspro/processlibrary/...,
"srvany.exe is an additional Microsoft Windows application which
allows an executable to be ran as a service.". Hope this helps.

Cheers,

Jeremy Henty