[mod_python] Child shutdowns?

Gregory (Grisha) Trubetskoy grisha at modpython.org
Fri Aug 29 17:11:28 EST 2003


Barry

If I remember this correctly, from the viewpoint of Apache, to create a
server object (or server_rec structure) you need to have a request,
because a server is created based on what the "Host:" header says (if it
is there at all) and by then going throught the config to see if there is
anything relevant. Once a server is created, it is cached and reused, but
it is not created at Apache startup (as an extreme example, mod_vhost
allows you to create an unlimited number of virtual servers without
specifying them in the config at all - so there is no way to know what the
server name is until a request for it comes in).

I don't know if Apache provides a way to do something at server creation
time, I'll check it out, but it's unlikely. For right now, the only way to
register a server cleanup is from within a request :-(

Grisha

On Fri, 29 Aug 2003, Barry Warsaw wrote:

> I'm very likely missing it, but is there some way to run a callable when
> the child processes are terminated (i.e. through apachectl stop)?
>
> Seems like the server object's register_cleanup() ought to do it, except
> that I have some startup code that gets run when my main module is
> imported and at that point I don't have a request object to use as the
> first argument to register_cleanup().
>
> Any hints (or examples!)?
>
> Thanks,
> -Barry
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list