Re: Terminating Child process Dynamically

Perrin Harkins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC0_be0pdjNx7M9eEHeENMLCY69i_GRD4Dsm5MOHjfV1v7KDNA@mail.gmail.com>
On Fri, Mar 2, 2012 at 3:20 AM, Shibi Ns <[email protected]> wrote:
> I would like terminate current sever Child  process after the end of current
> request because some data is cached and data is changed after the process
> creation.  The data cached during InitChild phase
>
> Is it possible ?

It certainly is!  You can use $r-->child_terminate().  You might put
this in a cleanup handler.  You can see example code in
Apache2::SizeLimit.

However, this isn't what I would do.  I would make a cleanup handler
that checks somehow to see if the data has changed (stat a file for
modtime?) and then reloads the data.  It's more efficient than
spawning a new process, albeit somewhat more complicated.

- Perrin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.