At 15:01 +0300 21.07.2005, Octavian Rasnita wrote:
I would like to create a Windows service in Perl. Is it possible, or I am
able just to run/stop/pause services created in other languages?
If yes, please give me some hints and tell me what modules to use.

You can run Perl programs as services using Microsoft's 'srvany.exe' program, which is distributed as part of the NT Resource Kit. You use the 'instsrv.exe' program (also part of the resource kit) to create a new service that calls 'srvany.exe'. You then use the Registry Editor to tell 'srvany.exe' to launch Perl and invoke the script you specify.

There are articles on using 'srvany.exe' at:

   http://www.windowsitpro.com/Article/ArticleID/8148/8148.html
   http://www.windowsitpro.com/Windows/Article/ArticleID/7959/7959.html

and Microsoft has some documentation of their own. The NT Resource Kit, which contains these programs, is available from Microsoft. I believe that it's available for download, but you may have to do some digging to find it.

I should caution you that this approach doesn't seem to be entirely reliable. I've sometimes seen 'srvany.exe' fail to notice that Perl had exited, so that the service didn't restart automatically even though Perl wasn't running any more.

ActiveState also offer a tool called PerlSvc as part of the 'pro' version of their Perl developer tools. I haven't tried this, but details are at:

  http://www.activestate.com/Products/Perl_Dev_Kit/more_information.plex

Hope that helps,

Angus
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to