Perl and Windows 2000 Service. 
Author Message
 Perl and Windows 2000 Service.

Perl gurus,

I have a perl script which is watching a Oracle DB, waiting for a certain
column to change value; once done, it fires of an exe. I execute this script
from the command prompt, say : C:\watch.pl.

I needed to convert this script into a Service on the server. So, following the
steps as described in http://www.*-*-*.com/ , which I
found, everything is set up.

But now, I find an instance of perl.exe running in the process list instead of
seeing my script. What am i doing wrong? I am a newbie to perl. So please bear
with me...

Thanks in advance.
=Frank.

--
Posted from  [65.115.221.98]
via Mailgate.ORG Server - http://www.*-*-*.com/



Fri, 14 May 2004 17:50:45 GMT  
 Perl and Windows 2000 Service.
The url should read : http://www.perlguy.com/articles/nt_service.html

=Frank

--
Posted from  [65.115.221.98]
via Mailgate.ORG Server - http://www.Mailgate.ORG



Fri, 14 May 2004 17:54:54 GMT  
 Perl and Windows 2000 Service.

Quote:
> Perl gurus,

> But now, I find an instance of perl.exe running in the process list
> instead of seeing my script. What am i doing wrong? I am a newbie
> to perl. So please bear with me...

I am not really a Perl guru, but it appears to me that you should not be
overly surprised by finding an instance of perl running; for it is not your
script that runs perl, but perl which runs your script (perhaps as an
argument to perl?).

- Mark



Fri, 14 May 2004 17:57:47 GMT  
 Perl and Windows 2000 Service.
Mark,

Interesting. But perl.exe does not show up in the Task mgr list
when I run it from the command prompt. So the dilemma...

=Frank


Quote:
> I am not really a Perl guru, but it appears to me that you should not be
> overly surprised by finding an instance of perl running; for it is not your
> script that runs perl, but perl which runs your script (perhaps as an
> argument to perl?).

> - Mark

--
Posted from  [65.115.221.98]
via Mailgate.ORG Server - http://www.Mailgate.ORG


Fri, 14 May 2004 18:02:20 GMT  
 Perl and Windows 2000 Service.

Quote:
> Mark,

> Interesting. But perl.exe does not show up in the Task mgr list
> when I run it from the command prompt. So the dilemma...

Hmm, the doc says that if you run:

INSTSRV NAME_OF_SERVICE C:\WINNT\SRVANY.EXE

You should see NAME_OF_SERVICE in your task manager, which could be the name
of your script, or a descriptive name. I guess, since SRVANY.EXE is said to
run perl.exe as an argument, you may never really see perl.exe in your task
manager.

Did you set the AppParameters of the perl executable too? (it should point
to your script). If so, you will have to provide us with a little more info
on the steps you took run to "daemonize" your script.

- Mark



Fri, 14 May 2004 18:46:13 GMT  
 Perl and Windows 2000 Service.
On Mon, 26 Nov 2001 16:50:45 +0000 (UTC), "Bubba Frank"

Quote:
>I needed to convert this script into a Service on the server. So, following the
>steps as described in http://www.perlguy.com/article/nt_service.html, which I
>found, everything is set up.

SNIP
Try this:

http://www.roth.net/perl/scripts/scripts.asp?DirMon.pl

--
TMTOWTDI: My way tends to be wrong...



Fri, 14 May 2004 19:55:26 GMT  
 Perl and Windows 2000 Service.
Mark,

Quote:

> You should see NAME_OF_SERVICE in your task manager, which could be the name
> of your script

I named it MyDBWatch(descriptive name) and ran the svrany. MyDBWatch did
come up in the Services list.

Next,regeditted new MyDBWatch string keys:
Application - D:\Perl\bin\perl.exe &
AppParameters: D:\WatchDB\Watch.pl

Back to Administrator->Services->MyDBWatch. Checked all the declarations.
Set service to automatic. Started the service. Rebooted the server.

My real dilemma is, is my service running at all? When I run the Watch.pl from
C.Prompt, i have messages like 'Watching Oracle Table XYZ'... Now, since the
service is running silently(dont know) and i have no C.Prompt open, I am not
sure it is running. And I cannot really test it as I am working on a Production
Database. So I have to make sure this is Production ready before moving to the
real server...

=Frank

--
Posted from  [65.115.221.98]
via Mailgate.ORG Server - http://www.Mailgate.ORG



Fri, 14 May 2004 20:30:11 GMT  
 Perl and Windows 2000 Service.
Quote:

> On Mon, 26 Nov 2001 16:50:45 +0000 (UTC), "Bubba Frank"

> >I needed to convert this script into a Service on the server. So, following the
> >steps as described in http://www.perlguy.com/article/nt_service.html, which I
> >found, everything is set up.
> SNIP
> Try this:

> http://www.roth.net/perl/scripts/scripts.asp?DirMon.pl

> --
> TMTOWTDI: My way tends to be wrong...


Also notice in this example, that messages are written to a file, not to
STDERR/STDOUT (I don't believe these file handles exist for a service).
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


Sat, 15 May 2004 00:23:50 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Network Access as Windows 2000 Service?

2. Making a script a Windows 2000 service

3. mod_perl apache windows 2000 is not running perl scripts simultaneously

4. Installing ActiveState Perl on Windows 2000 Pro

5. Perl paths in Windows 2000

6. Perl and Windows 2000

7. - Cerco Perl e PerlCgi con manuale in italiano in ambiente windows 98 o 2000 da scaricare

8. perl cgi not working in windows 2000

9. Problems with access a smb mount ona windows 2000 server with activestate perl

10. Active Perl & Windows 2000

11. Building Perl with 64-bit integer support on Windows 2000

12. Problems with a Perl scheduled task in windows 2000

 

 
Powered by phpBB® Forum Software