Thanks for responding. Late last night I solved the problem. Just for everyone's information and possible future use I will describe the solution.
First off I tried calling system with the first parameter of '1', which was supposed to work, by asynchronously creating the new process and returning...but it didn't work either. Also system() is supposed to return the child PID, but it doesn't with the version of PERL that my system is running...it returns a process handle ID. Here is my PERL version.
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
Copyright 1987-2005, Larry Wall
Here is what I tried, and it didn't work. The parent process didn't return 0, until the child process exited.
$ChildPID = system 1, $CMDLine;
my $Lock = Glck->new($ResName);
LOG_MSG("I", "Online.pl is about to exit with 0.", 52099);
exit (0);
The solution that worked is this. I went back to using Win32::Process::Create( ) but called it with the DETACHED_PROCESS creation flag set. And this worked as I wanted it to. Online.pl called Create() and then returned '0' back to my server.
require Win32::Process;
my $ParentPID;
$ParentPID = $$;
LOG_MSG("I", "ParentPID = $ParentPID before creating child.", 5209
+9, $ParentPID);
Win32::Process::Create($ChildProc, $CMD, $CMDLine, 0, DETACHED_PRO
+CESS, $CWD) || LOG_MSG("E", "Could not spawn child: $!", 52099);
$ChildPID = $ChildProc->GetProcessID();
LOG_MSG("I", "ChildPID = $ChildPID", 52099, $ChildPID);
my $Lock = Glck->new($ResName);
$Lock->lock_mk($ChildPID);
LOG_MSG("I", "Online.pl is about to exit with 0.", 52099);
exit (0);
Thanks for looking into this problem for me, I hope this solution helps some of you. I am sure that I will require all of your assistance in the future ;-)
|