[mod_python] How to make mod_python know when Apache is shutdown/restarted?

Scott Chapman scott_list at mischko.com
Fri Aug 5 17:52:03 EDT 2005


Scott Chapman wrote:
> I need to make mod_python close the database connection nicely when 
> Apache is shutdown or restarted.  How do I get this info into 
> mod_python's world?

I found the Server's "register cleanup(request, callable[, data ])" method.

When do I call it?

It seems it should be done once per Apache child process, not with every 
request.  I don't see a way to run something only when mod_python is 
instantiated initially.

I'm using mpservlets in case that makes any difference (I doubt it).

Thanks!
Scott


More information about the Mod_python mailing list