use a NULL c->sbh pointer with httpd 2.4 (possible fix for #867276)

- add logging for unexpected daemon process loss
Resolves: rhbz#867276
This commit is contained in:
Joe Orton 2012-10-17 09:53:42 +01:00
parent f9879fb5c6
commit 76920be5e5
3 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,16 @@
--- mod_wsgi-3.4/mod_wsgi.c.connsbh
+++ mod_wsgi-3.4/mod_wsgi.c
@@ -10600,7 +10600,13 @@ static void wsgi_process_socket(apr_pool
* will add their own input/output filters to the chain.
*/
+#if AP_MODULE_MAGIC_AT_LEAST(20110619,0)
+ /* For 2.4 a NULL sbh pointer should work. */
+ sbh = NULL;
+#else
+ /* For 2.2 a dummy sbh pointer is needed. */
ap_create_sb_handle(&sbh, p, -1, 0);
+#endif
c = (conn_rec *)apr_pcalloc(p, sizeof(conn_rec));

View File

@ -0,0 +1,23 @@
--- 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_DEBUG(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_DEBUG(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);
}

View File

@ -6,7 +6,7 @@
Name: mod_wsgi
Version: 3.4
Release: 2%{?dist}
Release: 3%{?dist}
Summary: A WSGI interface for Python web applications in Apache
Group: System Environment/Libraries
@ -14,6 +14,8 @@ License: ASL 2.0
URL: http://modwsgi.org
Source0: http://modwsgi.googlecode.com/files/%{name}-%{version}.tar.gz
Source1: wsgi.conf
Patch0: mod_wsgi-3.4-connsbh.patch
Patch1: mod_wsgi-3.4-procexit.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: httpd-devel
@ -30,6 +32,8 @@ existing WSGI adapters for mod_python or CGI.
%prep
%setup -q
%patch0 -p1 -b .connsbh
%patch1 -p1 -b .procexit
%build
export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}"
@ -61,6 +65,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Wed Oct 17 2012 Joe Orton <jorton@redhat.com> - 3.4-3
- use a NULL c->sbh pointer with httpd 2.4 (possible fix for #867276)
- add logging for unexpected daemon process loss
* Wed Oct 17 2012 Matthias Runge <mrunge@redhat.com> - 3.4-2
- also use RPM_LD_FLAGS for build bz. #867137