Phil,

A very worthy submission, but Dave Roth and Dutrieux Yves got it 
right.  I'm using an account in the service setup from our dev box and I'm 
on a QA box.  Duuuh...  But thanks for pointing that out.  That is a gotcha 
that I covered under v1.0 of my script and may be good for others to see.

And the point of the first line "#!/usr/bin/perl -w" is I am often 
flip-flopping between Unix and Windows.  I develop on Unix, use CVS, and 
connect between Unix and Windows using Samba.  At some point in 
development, esp. when Win32 mods are used, this breaks down of course, but 
having the header initially just works very well because Windows ignores 
it, but Unix requires it.  Another VERY BIG reason is that I use Cygwin 
under windows to run and test things and it needs it too, and the Win32 
mods ARE used and I NEED the bang path line.  I replace (via soft link) the 
perl.exe that comes with Cygwin with the ASPerl binary.  It picks up all 
the Win32 mods and I run in an environment that I feel is superior to the 
"DOS" command prompt in Windows.  So that's why... 8~)

Thanks for your submission.

chris
-----
Chris Olive
[EMAIL PROTECTED]

At 4/23/2002 08:51 AM +0100, you wrote:

>I have found that to run Perl scripts as services, using the NT Resource
>Kit srvany.exe tool, in the Parameters/Application key value, you have to
>specify the full path of the perl interpreter, followed by the full path of
>your script, i.e:
>
>C:\perl\bin\perl.exe C:\mydir\mysubdir\myscript.pl
>
>Not sure if this is your problem here, but it might be worth checking.
>Also, as an additional point, in the extract of the script you provided,
>what is the point of this line:
>
>#!/usr/bin/perl -w
>
>if you are using a Windows Operating System, not a Unix/Linux one?
>
>HTH,
>
>Phil Morley
>
>
>
> 
>
>                     Chris 
> Olive 
>
>                     <[EMAIL PROTECTED]>                   To: 
> [EMAIL PROTECTED]
>                     Sent 
> by:                                     cc: 
>
>                     [EMAIL PROTECTED]        Subject: 
>      Problem with IO::File running .pl as
>                     eState.com                                   NT 
> Service?
> 
>
> 
>
>                     23/04/02 
> 05:33 
>
> 
>
> 
>
>
>
>
>I've got a hot deadline, and I can use all the help/extra eyes I can get to
>
>speed diagnosing this problem...
>
>I don't have time to go into all the background specifics -- those that are
>
>in the know will know what I am talking about here -- but I need to
>run/have run a Perl script as a Windows NT service.  I use the SRVANY.EXE
>image from the Windows 2K Resource Kit, and the instructions on the kit
>that go with it.  Works fine; been using it on a v1.1 production system for
>
>a while.  Just upgraded the Perl script to v1.2, and in trying to run the
>script using SRVANY.EXE, it appears not to work.
>
>We all know the debugging routine, right?  Write a little test strap and
>start finding out what's going on.  So I did.  It LOOKS LIKE to me that a
>Perl module I wrote to create an ASCII log file is the thing that is
>keeping this little baby from running.  The logging module called
>AutoLogger.pm works BEAUTIFULLY from a Command Prompt window.  When running
>
>as an NT Service, it appears to keep the script from running properly.  The
>
>only module I am using in AutoLogger.pm is IO::File.  I know the NT Service
>
>environment isn't the same as the environment one gets at a Command
>Prompt.  So I'm wondering if there is something squirrly with IO:File in an
>
>NT Service "shell."
>
>Anyway, here's the test strap (works GREAT when I leave the logging calls
>out...):
>
>#!/usr/bin/perl -w
>
>use strict;
>use Utils qw( :Shell );
>use AutoLogger;
>
>my $interval = $ARGV[0] || 60;
>## my $log = AutoLogger->new( $ARGV[1] || "NetSend2.log" );
>
>## $log->entry( "Starting loop..." );
>## $log->variables( { interval => $interval } );
>
>while () {
>## $log->block( "About to shell" );
>     Shell( qq{net send t00299457 "Parameters: @ARGV"} );
>     last if (-e "stop");
>     sleep $interval;
>}
>
>## $log->close;
>
>
>AutoLogger.pm is a bit long to present here.  A copy of it can be found at:
>
>http://www.technologEase.com/misc/support/AutoLogger.html
>
>If anyone cares to take a look.  I gotta get this solved FAST, so any extra
>
>eyes are welcome...  I don't see anything that could behold it up.  Like I
>said AutoLogger.pm works BEAUTIFULLY in a normal Command Prompt
>environment.
>
>Thanks,
>Chris
>-----
>Chris Olive
>[EMAIL PROTECTED]
>
>_______________________________________________
>Perl-Win32-Admin mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
>
>
>
>_______________________________________________
>Perl-Win32-Admin mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to