Perl Executable Running as an NT Service 
Author Message
 Perl Executable Running as an NT Service

To All:

If I have a compiled perl (ACTIVESTATE) script running
as a service on Windows NT:

1) Is setting up the main body of the program
   as an infinite loop the way to go ?

   while(1) { # main body as an infinite loop

   # do something with out end

   }
   close FIL1;
   close FIL2;

   sub routine1(){
   ...
   }
   sub routine2(){
   ...
   }

2) What happens when the program gets a shutdown signal ?
   Does any open file close automatically ? If not, should
   there be a way of intercepting the shutdown call from
   the system (in order to safely close down any open files) ?



Tue, 23 Apr 2002 03:00:00 GMT  
 Perl Executable Running as an NT Service
Eisen,


Quote:
> To All:

> If I have a compiled perl (ACTIVESTATE) script running
> as a service on Windows NT:

> 1) Is setting up the main body of the program
>    as an infinite loop the way to go ?

>    while(1) { # main body as an infinite loop

> ...

I don't see why this wouldn't work.

Quote:

> 2) What happens when the program gets a shutdown signal ?
>    Does any open file close automatically ? If not, should
>    there be a way of intercepting the shutdown call from
>    the system (in order to safely close down any open files) ?

Why not use the END subroutine block to close any files you have open?
see http://www.rexswain.com/perl5.html#subroutines

Also, see the fall issue of The Perl Journal for an article on running a
Perl program as a NT service.
www.tpj.com. Unless you want to become a subscriber, you'll have to pick
this up at any fine bookstore/newsstand (I was surprised to find a copy at
Borders)

--
===========================================================
Mark Bridgwater
Web-developer: Perl, ASP, Linux



Tue, 23 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Perl Executable Running as an NT Service

2. Running perl scripts on NT as a Service

3. How to run Perl program as NT service?

4. run perl script like a service on NT

5. Running a perl process as service under Win NT

6. NT Services: running perl scripts

7. How to run Perl program as NT service?

8. Running Perl scripts as NT services

9. Running Perl scripts as NT services

10. Perl scripts running as NT services

11. Perl scripts running like NT Service

12. Running perl scripts like NT services

 

 
Powered by phpBB® Forum Software