f0d6ab
f0d6ab
Log exit status in daemon manager; improves diagnosics.
f0d6ab
f0d6ab
http://code.google.com/p/modwsgi/source/detail?path=/mod_wsgi.c&name=mod_wsgi-3.X&r=b4f55d756fa816a7eae0f7edc13d5f2da3f3d5c1
f0d6ab
f0d6ab
--- mod_wsgi-3.3/mod_wsgi.c.procexit
f0d6ab
+++ mod_wsgi-3.3/mod_wsgi.c
f0d6ab
@@ -9845,6 +9845,20 @@ static void wsgi_manage_process(int reas
f0d6ab
                              wsgi_server, "mod_wsgi (pid=%d): "
f0d6ab
                              "Process '%s' has died, restarting.",
f0d6ab
                              daemon->process.pid, daemon->group->name);
f0d6ab
+                if (WIFEXITED(status)) {
f0d6ab
+                    ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0),
f0d6ab
+                                 wsgi_server, "mod_wsgi (pid=%d): "
f0d6ab
+                                 "Process '%s' terminated normally, exit code %d", 
f0d6ab
+                                 daemon->process.pid, daemon->group->name,
f0d6ab
+                                 WEXITSTATUS(status));
f0d6ab
+                }
f0d6ab
+                else if (WIFSIGNALED(status)) {
f0d6ab
+                    ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0),
f0d6ab
+                                 wsgi_server, "mod_wsgi (pid=%d): "
f0d6ab
+                                 "Process '%s' terminated by signal %d", 
f0d6ab
+                                 daemon->process.pid, daemon->group->name,
f0d6ab
+                                 WTERMSIG(status));
f0d6ab
+                }
f0d6ab
 
f0d6ab
                 wsgi_start_process(wsgi_parent_pool, daemon);
f0d6ab
             }