Is there any Apache disconnect hook for cleanup?

I am currently developing a module for Apache 2 / 2.2 and must do some cleanup before the main Apache process (and not child processes) finishes.

I searched extensively, not finding any recommendations as to which hook to use. Can anyone help point me in the right direction?

+4
source share
1 answer

I'm not sure what you are trying to do, but I think the functions apr_reslist_create and apr_pool_cleanup_register can help you. One of the parameters in the apr_reslist_create function is apr_reslist_destructor, which you can use to pass the destructor function. Also, I think you should take a look at the source code of the mod_dbd module, as this is a pretty good example of how to create and clean up external resources from the apache process.

Apr-Util apr_reslist_create

Apr apr_pool_cleanup_register

+2
source

Source: https://habr.com/ru/post/1302185/


All Articles