On Mon, 13 Oct 2003, Steve Hay wrote:
[ .. ]
> It's true that we don't need the PID file on Win32. In fact, we don't
> even need the PID -- the following chunk of your patch below:
>
> if (my $pid = $obj->GetProcessID) {
> Win32::Process::KillProcess($pid, 0);
> }
> else {
> $obj->Kill(0);
> }
>
> could even just be:
>
> $obj->Kill(0);
>
> couldn't it?
That's true .... I had the two (KillProcessID and Kill) in
there so that a second attempt to kill the process would be
made in case the first attempt failed. I'm not sure if there
are circumstances where the 2nd attempt would succeed when
the 1st attempt failed, but I thought it worth a try ...
Do you know if there'd be any advantage to leaving the two
attempts in there?
> But what about other OS's? Stas said that Linux/Unix (and presumably
> all other supported OS's too) has the same problem with stale PID files
> kicking around, so I was trying to do something that addressed that too.
>
> I'm happy with your patch below (perhaps simplified as above if you
> agree there is no point in the GetProcessID() call) on Win32. I'll let
> others decide what's best on other platforms.
I was just concentrating on Win32 for the moment - perhaps
it's better to address other OSs separately ...
> We also still need a solution to the similar problem in TestSmoke.pm --
> I posted a patch that changes a nasty `cat $pidfile` to something nicer,
> but the PID that is read from the file is then killed with a kill(SIGINT
> => $pid)! (See TestSmoke::kill_proc.) How can we fix that? There
> isn't a Win32::Process object available there since we've used IPC::Run3
> rather than Win32::Process! Perhaps we should just trust that IPC::Run3
> has cleaned up correctly and there is no need to kill anything ourselves?
If we adopt the philosophy on Win32 that the pid file not be
used, and instead let the process object handle everything,
then I'd agree that, on Win32, we just let IPC::Run3 handle
things. So for the kill_proc() method of Apache::TestSmoke
we could just return immediately when it's called on Win32.
For other OSs there may be advanyages to using your patch of
opening and reading the pid file, rather than using `cat
$file`, as the pid() method of Apache::TestServer does.
> One other nit: I notice that the "Unclean shutdown" message that we've
> added doesn't seem to appear anywhere! Neither the console nor the
> error_log! Where does it go?
I got it coming up in the console window if I comment out
the unlinking of $self->pid_file when shutting down the
server, and then running the tests again.
--
best regards,
randy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]