When I run my script as a Windows Service script using Perl, it works
fine.  STDOUT redirects no problem.

When I compile my script into a freestanding executable and run it from
command line, STDOUT redirects with no problems.

When I compile my script into a freestanding executable and run it as a
Windows Service, STDOUT does not redirect and I get a Bad File
Descriptor error.

I believe I'm having the same issues as you are.  I'm using IO::Socket
to read in sockets information and now I'm simply going to read in the
socket and write it to a file and have the new process work with this
file.  Though I'm having problems getting lines from the socket.

Chuck


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Philip Morley
Sent: Friday, August 09, 2002 10:38 AM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Perlapp - Win32::Daemon Access Denied error (new question)


It has been my experience that Win32::Daemon doesn't allow you to
redirect
STDOUT/STDERR.  I posted a question about this to the newsgroup some
time
ago, and to roth.net, but got no reply.  I'll dig out my query and
re-post
it to see if anyone replies, also if what I reported is anything like
what
you are experiencing.

I don't quite understand how you are running your script (as a service,
as
a compiled exe, from the command line).  Please can you describe?

Phil Morley



|---------+----------------------------------------------->
|         |           "Chuck Lee" <[EMAIL PROTECTED]> |
|         |           Sent by:                            |
|         |           [EMAIL PROTECTED]|
|         |           veState.com                         |
|         |                                               |
|         |                                               |
|         |           08/08/02 18:55                      |
|         |           Please respond to chuck.lee         |
|         |                                               |
|---------+----------------------------------------------->
 
>-----------------------------------------------------------------------
-------------------------|
  |
|
  |        To:      <[EMAIL PROTECTED]>
|
  |        cc:
|
  |        Subject: RE: Perlapp - Win32::Daemon Access Denied error (new
question)                 |
 
>-----------------------------------------------------------------------
-------------------------|



Hrmm it appears that the problem isn't with Win32::Process::Create but
with
my backing up STDOUT.

<snip>
1.           open ( OLD_STDOUT, ">&STDOUT" ) || die "Cannot backup
STDOUT:
$!\n";
2.           open ( STDOUT, ">&" . $sock->fileno() ) || die "Cannot
redirect STDOUT:
$!\n";
</snip>

This works no problem when I run the service using Perl and the script
name,
but when I compile into an .exe and attempt to run it dies at 1.  with a
reported error of "Cannot backup STDOUT: Bad file descriptor".  How is
it
that I can have a bad file descriptor?

thanks
Chuck

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Philip Morley
Sent: August 8, 2002 4:16 AM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Perlapp - Win32::Daemon Access Denied error (new question)



Not without seeing a snippet of your code.  I have successfully used
Win32::Process within WIn32::Daemon to spawn new processes, so it can
work.
My initial guess is that it might be something to do with what the
$cflags
parameter in the Win32::Process::Create function are set to.  I just
checked my script, and this is set to THREAD_PRIORITY_NORMAL (0).  I can
remember having to experiment with the setting that worked the best.

HTH,

Phil Morley


|---------+----------------------------------------------->
|         |           "Chuck Lee" <[EMAIL PROTECTED]> |
|         |           Sent by:                            |
|         |           [EMAIL PROTECTED]|
|         |           veState.com                         |
|         |                                               |
|         |                                               |
|         |           07/08/02 18:37                      |
|         |           Please respond to chuck.lee         |
|         |                                               |
|---------+----------------------------------------------->

>
------------------------------------------------------------------------
---
---------------------|
  |
|
  |        To:      <[EMAIL PROTECTED]>
|
  |        cc:
|
  |        Subject: RE: Perlapp - Win32::Daemon Access Denied error (new
question)                 |

>
------------------------------------------------------------------------
---
---------------------|




Actually I figured this one out it was my stupidity.  Anyways, I have
one
more question that hopefully isn't as stupid:

The service that I created using Win32::Daemon also uses Win32::Process
to
spawn new processes.  If I run the executable via command line, new
processes spawn with no problems.  But if the service is running, a new
process is not spawned.  Anyone know why this may be happening?

thanks
Chuck

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Chuck Lee
Sent: August 6, 2002 11:30 AM
To: [EMAIL PROTECTED]
Subject: Perlapp - Win32::Daemon Access Denied error


I have a perl script that I've succesfully run as a service using Perl.
I've compiled it into an exectuable using Perlapp but when I go to start
it
I get an Access Denied error.  I've ran it as LOCALSYSTEM and the local
administrator with no luck.  Any ideas?  I'm also curious as to what I
should specify as the path when running a Perlapp executable as a
service.

thanks
Chuck

_______________________________________________
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

_______________________________________________
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