Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl script into a Windows Service

Reply
Thread Tools

Perl script into a Windows Service

 
 
Cosmic Cruizer
Guest
Posts: n/a
 
      02-06-2004
For the last several months, I have been trying to turn a simple Perl script
into a Windows 2000 service. I keep finding a lot of question about doing
this in newsgroups, but I have yet to find an easy to follow solution. Can
anybody recommend either a book, web page, article, or something that will
help me out? It almost sounds like setting up a Perl script to run as a
service is an urban legend.

Thanks,
 
Reply With Quote
 
 
 
 
Chris
Guest
Posts: n/a
 
      02-07-2004
Cosmic Cruizer wrote:
> For the last several months, I have been trying to turn a simple Perl script
> into a Windows 2000 service. I keep finding a lot of question about doing
> this in newsgroups, but I have yet to find an easy to follow solution. Can
> anybody recommend either a book, web page, article, or something that will
> help me out? It almost sounds like setting up a Perl script to run as a
> service is an urban legend.
>


No, it's not an urban legend. It's actually not that hard to do.
Recent versions of Perl make this rather easy to do. I know this sounds
weird, but I don't have access to the Web right now to find what I know
is out there, but do some searching on Dave Roth -- he's king of Perl
Win32 and I know I saw some outlines from him within the last two years
on the preferred way to create WinNT-based services using ActiveState Perl.

The poor man's method, which works best for older versions of
ActiveState Perl (esp. 5.00x) is to use Microsloth's SRVANY.EXE
executable. Look in Microsloth's (pathetic) Support/KB engine for
SRVANY.EXE and see what you come up with. There is a KB article that
explains the registry pokes/insertions that need to be done to setup
your own service using a script and SRVANY.EXE.

Writing an installer to install an app using either method is not hard
to do either.

I can be more specific about the SRVANY.EXE method if you need more
guidance. Hope this gets you going.

Chris
-----
Chris Olive
chris -at- --spammers-are-vermin-- technologEase -dot- com
http://www.technologEase.com
(pronounced "technologies")
 
Reply With Quote
 
 
 
 
Andy Hassall
Guest
Posts: n/a
 
      02-07-2004
On Fri, 06 Feb 2004 21:52:52 GMT, http://www.velocityreviews.com/forums/(E-Mail Removed) (Cosmic Cruizer)
wrote:

>For the last several months, I have been trying to turn a simple Perl script
>into a Windows 2000 service.


http://theoryx5.uwinnipeg.ca/CPAN/da...le/Simple.html

--
Andy Hassall <(E-Mail Removed)> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
 
Reply With Quote
 
Cosmic Cruizer
Guest
Posts: n/a
 
      02-07-2004
Andy Hassall <(E-Mail Removed)> wrote in <jec8205j9h5lt6pccf7aihusui37c5s3i2
@4ax.com>:

>http://theoryx5.uwinnipeg.ca/CPAN/da...le/Simple.html


Thanks Andy and Chris.

The link listed above is pretty easy to follow. I will need to give it a try
when I have a bit more time.

Since I finally needed to get something up and running for the weekend, I
kind of cheated. I'm trying out Firedaemon. It took me all of 10 minutes to
get my service up and running. But the real test will be on Monday when I
check out the server.

Thanks for the suggestions.
 
Reply With Quote
 
Kevin Sproule
Guest
Posts: n/a
 
      02-08-2004

"Cosmic Cruizer" <(E-Mail Removed)> wrote in message
news:Xns94878D34DB897ccruizermydejacom@64.164.98.5 1...
> For the last several months, I have been trying to turn a simple Perl

script
> into a Windows 2000 service. I keep finding a lot of question about doing
> this in newsgroups, but I have yet to find an easy to follow solution. Can
> anybody recommend either a book, web page, article, or something that will
> help me out? It almost sounds like setting up a Perl script to run as a
> service is an urban legend.
>
> Thanks,


Here are some generalized instructions that I use all the time to setup Perl
scripts as services under Windows NT 4.0, 2000, XP, and 2003:

Copy the INSTSRV.EXE and SRVANY.EXE files to C:\WINNT\SYSTEM32.

Run: INSTSRV Service_Name C:\WINNT\SYSTEM32\SRVANY.EXE
(This registers the service.) Service_name

Set the "Logon As" to Local System Account in the service properties.

Run: REGEDIT
Follow the chain:
HKEY_LOCAL_MACHINE
SYSTEM
CurrentControlSet
Services
Service_Name

Add the KEY: Parameters
Select (highlight) Parameters
Add the String Value: Application
String: C:\PERL\bin\perl.exe ( your path to the perl.exe program )
Add the String Value: AppParameters
String: C:\some_dir\perl_script.pl ( your path to the perl script to be
run )
Exit the Registry Editor.
Start the Service_Name service.

In the event that you want to remove the Service_Name service, stop the
service and run:
INSTSRV Service_Name REMOVE

I hope this helps.

Kevin Sproule


 
Reply With Quote
 
Cosmic Cruizer
Guest
Posts: n/a
 
      02-11-2004
"Kevin Sproule" <(E-Mail Removed)> wrote in
<D_uVb.25464$tP1.18372@fed1read07>:

>
>Here are some generalized instructions that I use all the time to setup
>Perl scripts as services under Windows NT 4.0, 2000, XP, and 2003:
>
>Copy the INSTSRV.EXE and SRVANY.EXE files to C:\WINNT\SYSTEM32.
>
>Run: INSTSRV Service_Name C:\WINNT\SYSTEM32\SRVANY.EXE
>(This registers the service.) Service_name
>
>Set the "Logon As" to Local System Account in the service properties.
>
>Run: REGEDIT
>Follow the chain:
> HKEY_LOCAL_MACHINE
> SYSTEM
> CurrentControlSet
> Services
> Service_Name
>
>Add the KEY: Parameters
>Select (highlight) Parameters
>Add the String Value: Application
> String: C:\PERL\bin\perl.exe ( your path to the perl.exe program
> )
>Add the String Value: AppParameters
> String: C:\some_dir\perl_script.pl ( your path to the perl script
> to be
>run )
>Exit the Registry Editor.
>Start the Service_Name service.
>
>In the event that you want to remove the Service_Name service, stop the
>service and run:
> INSTSRV Service_Name REMOVE
>
>I hope this helps.
>
>Kevin Sproule
>
>
>


WOW... Talk about easy. Thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI: Execute a perl script inside another perl script xdarcos@hotmail.com Perl Misc 20 01-18-2005 12:33 PM
Execute another perl script from my perl script Petterson Mikael Perl Misc 3 01-05-2005 01:31 PM
problem calling perl script from SOAP server perl script pj Perl Misc 3 04-09-2004 10:23 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments