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.
Martin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
[Wed Feb 25 03:32:56 2009] [notice] Parent: Received restart signal --
Restarting the server.
[Wed Feb 25 03:32:56 2009] [notice] Child 3920: Exit event signaled. Child
process is ending.
[Wed Feb 25 03:32:56 2009] [warn] mod_wsgi: Compiled for Python/2.4.4.
[Wed Feb 25 03:32:56 2009] [warn] mod_wsgi: Runtime using Python/2.4.1.
[Wed Feb 25 03:32:56 2009] [warn] mod_wsgi: Python module path
'C:\\WINDOWS\\system32\\python24.zip;C:\\Python24\\Lib;C:\\Python24\\DLLs;C:\\Python24\\Lib\\lib-tk;;C:\\Program
Files\\Apache2.2\\bin'.
[Wed Feb 25 03:32:56 2009] [notice] Digest: generating secret for digest
authentication ...
[Wed Feb 25 03:32:56 2009] [notice] Digest: done
[Wed Feb 25 03:32:56 2009] [notice] Apache/2.2.4 (Win32) mod_wsgi/2.3
Python/2.4.1 configured -- resuming normal operations
[Wed Feb 25 03:32:56 2009] [notice] Server built: Jan 9 2007 23:17:20
[Wed Feb 25 03:32:56 2009] [notice] Parent: Created child process 5596
[Wed Feb 25 03:32:56 2009] [error] python_init: Python version mismatch,
expected '2.4.3', found '2.4.1'.
[Wed Feb 25 03:32:56 2009] [error] python_init: Python executable found
'C:\\Program Files\\Apache2.2\\bin\\httpd.exe'.
[Wed Feb 25 03:32:56 2009] [error] python_init: Python path being used
'C:\\WINDOWS\\system32\\python24.zip;C:\\Python24\\Lib;C:\\Python24\\DLLs;C:\\Python24\\Lib\\lib-tk;;C:\\Program
Files\\Apache2.2\\bin'.
[Wed Feb 25 03:32:56 2009] [notice] mod_python: Creating 8 session mutexes
based on 0 max processes and 250 max threads.
[Wed Feb 25 03:32:56 2009] [warn] mod_wsgi: Compiled for Python/2.4.4.
[Wed Feb 25 03:32:56 2009] [warn] mod_wsgi: Runtime using Python/2.4.1.
[Wed Feb 25 03:32:56 2009] [warn] mod_wsgi: Python module path
'C:\\WINDOWS\\system32\\python24.zip;C:\\Python24\\Lib;C:\\Python24\\DLLs;C:\\Python24\\Lib\\lib-tk;;C:\\Program
Files\\Apache2.2\\bin'.
[Wed Feb 25 03:32:56 2009] [notice] Digest: generating secret for digest
authentication ...
[Wed Feb 25 03:32:57 2009] [notice] Digest: done
[Wed Feb 25 03:32:57 2009] [notice] Child 5596: Child process is running
[Wed Feb 25 03:32:57 2009] [notice] Child 3920: Released the start mutex
[Wed Feb 25 03:32:57 2009] [notice] Child 5596: Acquired the start mutex.
[Wed Feb 25 03:32:57 2009] [notice] Child 5596: Starting 250 worker threads.
[Wed Feb 25 03:32:57 2009] [notice] Child 5596: Starting thread to listen on
port 80.
[Wed Feb 25 03:32:58 2009] [notice] Child 3920: Waiting for 250 worker threads
to exit.
[Wed Feb 25 03:32:58 2009] [notice] Child 3920: All worker threads have exited.
[Wed Feb 25 03:32:58 2009] [notice] Child 3920: Child process is exiting