Blob Blame History Raw

Log exit status in daemon manager; improves diagnosics.

http://code.google.com/p/modwsgi/source/detail?path=/mod_wsgi.c&name=mod_wsgi-3.X&r=b4f55d756fa816a7eae0f7edc13d5f2da3f3d5c1

--- mod_wsgi-3.3/mod_wsgi.c.procexit
+++ mod_wsgi-3.3/mod_wsgi.c
@@ -9845,6 +9845,20 @@ static void wsgi_manage_process(int reas
                              wsgi_server, "mod_wsgi (pid=%d): "
                              "Process '%s' has died, restarting.",
                              daemon->process.pid, daemon->group->name);
+                if (WIFEXITED(status)) {
+                    ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0),
+                                 wsgi_server, "mod_wsgi (pid=%d): "
+                                 "Process '%s' terminated normally, exit code %d", 
+                                 daemon->process.pid, daemon->group->name,
+                                 WEXITSTATUS(status));
+                }
+                else if (WIFSIGNALED(status)) {
+                    ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0),
+                                 wsgi_server, "mod_wsgi (pid=%d): "
+                                 "Process '%s' terminated by signal %d", 
+                                 daemon->process.pid, daemon->group->name,
+                                 WTERMSIG(status));
+                }
 
                 wsgi_start_process(wsgi_parent_pool, daemon);
             }