win32 services

djberg96 on 2003-10-02T15:53:54

I've been working on a win32-service module for Ruby, using both the Perl and Python source for code that I can shamelessly plagiarize. Well, mostly just API ideas, since I'm writing everything in C, rather than using the Win32 module that comes with Ruby.

From there I want to run Ruby programs as a service. However, I've quickly learned that just slapping in "c:\ruby\bin\ruby myfile.rb" as the service binary argument doesn't work. Oh, sure, it will *create* the service, but it won't actually *run*.

This lead me back to Perl and Python. Unfortunately, I don't think the PerlSvc source is open (it's from ActiveState) and I can't find the source for the executable that Mark Hammond wrote to turn Python programs into Windows services. It may be closed source as well. I'm not sure.

Trying to find a tutorial on creating windows services has proved to be a bigger pain than I thought. The few that I've found I didn't like. Mainly, I just want something that says, "you must do X, Y and Z to setup your executable as a Windows service."

In the meantime, I've come across something called FireDaemon which may solve our problems for now. I'll have to play and see.