2009/2/25 Graham Dumpleton <[email protected]>: > 2009/2/25 Martin (gzlist) <[email protected]>: >> On 25/02/2009, Graham Dumpleton <[email protected]> wrote: >>> >>> >>> What I need is someone on Windows who knows ctype voodoo. In >>> particular, want to replace call to os.kill() with a ctypes call to >>> ap_signal_parent() with argument of SIGNAL_PARENT_RESTART. This should >>> have effect of telling Apache parent process to restart the single >>> child process that exists on Windows. >>> >>> Any takers? >> >> Tried with the code: >> >> def application(environ, start_response): >> import ctypes >> ctypes.windll.libhttpd.ap_signal_parent(1) >> result = "restart tried" >> start_response("200 OK", [ >> ("Content-Type", "text/plain; charset=UTF-8"), >> ("Content-Length", str(len(result)))]) >> return [result] >> >> You'll notice several things from the error log, #1 I should really >> update to the latest minor version of several things, #2 seems to have >> gone down and come back up again fine. A small amount of further >> testing didn't show up any obvious issues. >> >> Not sure how pleasant an idea doing this is for every script change >> is, at least with httpd -k restart you know when it's happening. > > Yes, but it is much better option than what people generally do which is to > set: > > MaxRequestsPerChild 1 > > as it will only occur when a change has actually been made. > > Thanks for working this out for me. I'll update the example code in > wiki and get someone to try it with a real application.
Okay, can someone take this to the next level and try it with the monitoring code in documentation on wiki about source code reloading? I have added a new section at end of document describing what needs to be done. http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode#Restarting_Windows_Apache May also be worthwhile reading: http://blog.dscpl.com.au/2008/12/using-modwsgi-when-developing-django.html first, as it explains in more specificity how to integrate it into a Django installation. If I can get further confirmation that it works properly in context of that monitoring code for triggering restarts, then I'll post an updated blog about it. Thanks. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
