How to run Perl program as NT service? 
Author Message
 How to run Perl program as NT service?

I would like to run a Perl program as an NT service so that it's started
on each reboot.
I created a batch file that calls perl with the script file name as a
parameter,
then I installed the .bat file as a service using SRVANY in the NT
Resource Kit.
I then tried to start the service using the Services control panel, but
it times out
with a message saying it can't start the service.   What's the "proper"
method
for doing this?

Any help is much appreciated.

--
Bob Fillmore, Technical Services Division       email:

  Information Management Branch,
  Natural Resources Canada,                     Voice: (613) 992-2832
  580 Booth St., Ottawa, Ont., Canada  K1A 0E4  FAX:   (613) 996-2953



Sun, 19 Aug 2001 03:00:00 GMT  
 How to run Perl program as NT service?
see srvany in the NT resource kit...

-Chris

Quote:

> I would like to run a Perl program as an NT service so that it's started
> on each reboot.
> I created a batch file that calls perl with the script file name as a
> parameter,
> then I installed the .bat file as a service using SRVANY in the NT
> Resource Kit.
> I then tried to start the service using the Services control panel, but
> it times out
> with a message saying it can't start the service.   What's the "proper"
> method
> for doing this?

> Any help is much appreciated.

> --
> Bob Fillmore, Technical Services Division       email:

>   Information Management Branch,
>   Natural Resources Canada,                     Voice: (613) 992-2832
>   580 Booth St., Ottawa, Ont., Canada  K1A 0E4  FAX:   (613) 996-2953



Mon, 20 Aug 2001 03:00:00 GMT  
 How to run Perl program as NT service?
It would be better if you either

    -installed the perl.exe as a service and specify the script as a
parameter. This is detailed in the servany documentation. I don't think
batch files run well as a service.

    -put the script in your startup directory

for more info, respond directly to me. I work a couple of blocks from your
address.

Quote:

>I would like to run a Perl program as an NT service so that it's started
>on each reboot.
........
>Any help is much appreciated.

>--
>Bob Fillmore, Technical Services Division       email:

>  Information Management Branch,
>  Natural Resources Canada,                     Voice: (613) 992-2832
>  580 Booth St., Ottawa, Ont., Canada  K1A 0E4  FAX:   (613) 996-2953



Mon, 20 Aug 2001 03:00:00 GMT  
 How to run Perl program as NT service?
Hiya,

Alongside this thread,a thought just struck me;
wouldnt it be a performance boost having the perl interpreter
loaded as a service.
Having it already loaded, straying the memory,should make the script
shoot faster,right. I mean,you dont have to load perl.exe and all its'
autoload stuff
every time you run your tiny 5000 bytes script.

...kinda like the Apache >>> mod_perl companionship...

Would this be an approach in words of performance ???

thunx
thomas


Quote:
>It would be better if you either

>    -installed the perl.exe as a service and specify the script as a
>parameter. This is detailed in the servany documentation. I don't think
>batch files run well as a service.

>    -put the script in your startup directory

>for more info, respond directly to me. I work a couple of blocks from your
>address.


>>I would like to run a Perl program as an NT service so that it's started
>>on each reboot.



Tue, 21 Aug 2001 03:00:00 GMT  
 How to run Perl program as NT service?
I just solved my own problem.... there was a typo in my setup of the SRVANY
service.
I'm still using a .bat file... it works OK.   Also, my program listens on a
network socket
and that appears to be working OK as well.
Thanks to all who replied.

  - Bob

Quote:

> I would like to run a Perl program as an NT service so that it's started
> on each reboot.
> I created a batch file that calls perl with the script file name as a
> parameter,
> then I installed the .bat file as a service using SRVANY in the NT
> Resource Kit.
> I then tried to start the service using the Services control panel, but
> it times out
> with a message saying it can't start the service.   What's the "proper"
> method
> for doing this?

> Any help is much appreciated.

> --
> Bob Fillmore, Technical Services Division       email:

>   Information Management Branch,
>   Natural Resources Canada,                     Voice: (613) 992-2832
>   580 Booth St., Ottawa, Ont., Canada  K1A 0E4  FAX:   (613) 996-2953

--

  Information Management Branch,
  Natural Resources Canada,                     Voice: (613) 992-2832
  580 Booth St., Ottawa, Ont., Canada  K1A 0E4  FAX:   (613) 996-2953


Tue, 21 Aug 2001 03:00:00 GMT  
 How to run Perl program as NT service?

<comp.lang.perl is a former newsgroup>


Quote:
> Hiya,

> Alongside this thread,a thought just struck me;
> wouldnt it be a performance boost having the perl interpreter
> loaded as a service.
> Having it already loaded, straying the memory,should make the script
> shoot faster,right. I mean,you dont have to load perl.exe and all its'
> autoload stuff
> every time you run your tiny 5000 bytes script.

> ...kinda like the Apache >>> mod_perl companionship...

> Would this be an approach in words of performance ???

I'm not sure that it would have any gains in performance (although
intuitively it should) however I think the enterprise would not be one
that would be encouraged - it would necessitate as far as I can see some
rather large changes to the Perl core for that platform and would require
some new inovation for the actual running of scripts - sure you could have
a stub like perlis.dll but works because there is another service handing
the scripts to it to run.

That said I'm sure we'd be interested in seeing the patches when you've
done them :)

/J\
--

Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>



Wed, 22 Aug 2001 03:00:00 GMT  
 How to run Perl program as NT service?

Quote:

> <comp.lang.perl is a former newsgroup>


> > Hiya,

> > Alongside this thread,a thought just struck me;
> > wouldnt it be a performance boost having the perl interpreter
> > loaded as a service.
> > Having it already loaded, straying the memory,should make the script
> > shoot faster,right. I mean,you dont have to load perl.exe and all its'
> > autoload stuff
> > every time you run your tiny 5000 bytes script.

You may take a look at http://www.pault.com -> Perl Application
Server. The design is that there is perl script  running forever
(server) and there are clients ( perl scripts, java or c programs,
e t.c. -) , that can ask server to invoke any (preloaded) perl function,
re-reading  those functions on-fly when the'r changed ( allows easy
debugging ). Works on any UNIX and Windows as well. Pure perl
solution.

Quote:
> > ...kinda like the Apache >>> mod_perl companionship...

For many tasks fast-cgi is better than mod_perl. With mod_perlyou have perl
executable / script running with each instance of
Apache ( eating resources, hard to sync e t.c.) Perl Application
server is closer to fast-cgi, but is _much_ more flexible.

Quote:
> > Would this be an approach in words of performance ???

Sure. Not only invoking perl executable eats the preformance,
but perl's compilation to bytecode, re-opening database
connections / handelrs e t.c. usualy causes significant
slowdown. It's why fast-cgi and similiar solutions are
so popular.

About running perl interpreter as a service is not a big
deal with srvany or similiar stuff. I wrote my own trivial
'cron' for NT  in 2 days, using MS example of the service.
The problem is resanoble API with such perl service.
I don't understand the advantages of such solution for
the real life. If you want fast CGI's - use existing solutions.
If you want 'fast perl script but not CGI on NT box' ...
Can't imagine the real task ...

Rgds.Paul.


www.pault.com

Perl Application Server : XML Tube : ...



Thu, 23 Aug 2001 03:00:00 GMT  
 How to run Perl program as NT service?

Quote:

>> <comp.lang.perl is a former newsgroup>

<snip 54 lines without a further word from me>

Er, Ok you might have trouble with your newsfeed, you might not have the
original post to hand - but if I get the attribution it would be quite
nice to have more than one line (and that irrelevant) quoted.

/J\
--

Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>



Fri, 24 Aug 2001 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. How to run Perl program as NT service?

2. Running perl scripts on NT as a Service

3. run perl script like a service on NT

4. Running a perl process as service under Win NT

5. NT Services: running perl scripts

6. Running Perl scripts as NT services

7. Perl Executable Running as an NT Service

8. Running Perl scripts as NT services

9. Perl scripts running as NT services

10. Perl scripts running like NT Service

11. Running perl scripts like NT services

12. Running perl scripts on NT as a Service

 

 
Powered by phpBB® Forum Software