From 1ee79ea2287c05476ad5cb3e596d2c495cc2a066d7e4462c4fc164460bac02d9 Mon Sep 17 00:00:00 2001 From: Roman Drahtmueller Date: Fri, 18 Nov 2011 15:55:03 +0000 Subject: [PATCH 1/3] - update to /etc/init.d/apache2: handle reload with deleted binaries after package update more thoughtfully: If the binaries have been replaced, then a dlopen(3) on the apache modules is prone to fail. => Don't reload then, but complain and fail. Especially important for logrotate! OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=350 --- apache2.changes | 9 +++++++++ rc.apache2 | 26 +++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/apache2.changes b/apache2.changes index 7d07a99..93ad464 100644 --- a/apache2.changes +++ b/apache2.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Nov 18 15:04:12 CET 2011 - draht@suse.de + +- update to /etc/init.d/apache2: handle reload with deleted + binaries after package update more thoughtfully: If the binaries + have been replaced, then a dlopen(3) on the apache modules is + prone to fail. => Don't reload then, but complain and fail. + Especially important for logrotate! + ------------------------------------------------------------------- Fri Oct 7 17:11:56 CEST 2011 - draht@suse.de diff --git a/rc.apache2 b/rc.apache2 index 08e2aa6..a83f564 100644 --- a/rc.apache2 +++ b/rc.apache2 @@ -6,8 +6,8 @@ # Copyright (c) 2004(?), 2005, 2006, 2007, 2008 SUSE Linux Products GmbH # # Authors: Rolf Haberrecker , 2001 -# Peter Poeml , 2002, 2003, 2004, 2005, 2006, 2007, -# 2008, 2009, 2010 +# Peter Poeml , 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011. +# Roman Drahtmueller , 2010, 2011, 2012. # # # /etc/init.d/apache2 @@ -162,6 +162,8 @@ case "$action" in echo -n "(not running)" else pid=$(<$pidfile) + # re-read exe symlink, it could be (deleted) in the meanwhile. + apache_bin=$(readlink /proc/$pid/exe 2>/dev/null) kill -TERM $pid 2>/dev/null case $? in 1) echo -n "(not running)";; @@ -175,7 +177,7 @@ case "$action" in if ! test -f /proc/$pid/exe; then break fi - if test "$(readlink /proc/$pid/exe 2>/dev/null)" = $apache_bin; then + if test "$(readlink /proc/$pid/exe 2>/dev/null)" = "$apache_bin"; then usleep 500000 else break @@ -261,7 +263,25 @@ case "$action" in rc_status ;; reload|force-reload|graceful) + # check if there is a deleted binary. If there is, then logrotate + # or other occasions will fail to reload, as dlopen(3) of apache + # modules is prone to fail due to symbol mismatches. + # in this case, we only complain and fail. + if [ ! -f $pidfile -a -f $pidfile.rpmsave ]; then mv $pidfile.rpmsave $pidfile; fi + executable=$( readlink /proc/$(cat $pidfile)/exe 2> /dev/null ) + case "$executable" in + *httpd*delete*) + echo -n "Reload httpd2 after package update: ignoring request. Please do a manual restart explicitly! " + rc_failed 1 + rc_status -v + rc_exit + ;; + *) + ;; + esac + echo -n "Reload httpd2 (graceful restart)" + cmdline=$(echo $apache_bin -f $httpd_conf $server_flags "$@") if eval $cmdline -t &> $logdir/rc$pname.out; then killproc -USR1 $apache_bin || return=$rc_failed From df135f4b2d413fd771f40d3a4f2360cdaf998d86e68fc96c8a7417aaa8f60eaa Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 2 Dec 2011 16:41:12 +0000 Subject: [PATCH 2/3] Accepting request 94928 from home:coolo:removeautomake add automake to buildrequires OBS-URL: https://build.opensuse.org/request/show/94928 OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=351 --- apache2.changes | 5 +++++ apache2.spec | 34 ++++++++++++---------------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/apache2.changes b/apache2.changes index 93ad464..d92b85e 100644 --- a/apache2.changes +++ b/apache2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Dec 2 07:18:56 UTC 2011 - coolo@suse.com + +- add automake as buildrequire to avoid implicit dependency + ------------------------------------------------------------------- Fri Nov 18 15:04:12 CET 2011 - draht@suse.de diff --git a/apache2.spec b/apache2.spec index e649372..14d95dd 100644 --- a/apache2.spec +++ b/apache2.spec @@ -15,12 +15,17 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - - Name: apache2 -BuildRequires: db-devel ed libapr-util1-devel libapr1-devel >= 1.4.2 openldap2 openldap2-devel -BuildRequires: openssl-devel pcre-devel zlib-devel +BuildRequires: automake +BuildRequires: db-devel +BuildRequires: ed +BuildRequires: libapr-util1-devel +BuildRequires: libapr1-devel >= 1.4.2 +BuildRequires: openldap2 +BuildRequires: openldap2-devel +BuildRequires: openssl-devel +BuildRequires: pcre-devel +BuildRequires: zlib-devel %if %{?suse_version:1}0 && 0%{?sles_version} == 9 BuildRequires: libcap %else @@ -69,11 +74,11 @@ BuildRequires: expat-devel # "Server:" header %define VENDOR SUSE %define platform_string Linux/%VENDOR -License: ASLv.. +License: Apache-2.0 Group: Productivity/Networking/Web/Servers %define realver 2.2.21 Version: 2.2.21 -Release: 1 +Release: 0 #Source0: http://www.apache.org/dist/httpd-%{version}.tar.bz2 Source0: http://httpd.apache.org/dev/dist/httpd-%{realver}.tar.bz2 # Add file to take mtime from it in prep section @@ -140,7 +145,6 @@ Patch106: httpd-2.2.x-CVE-2011-3368-server_protocl_c.diff Url: http://httpd.apache.org/ Icon: Apache.xpm Summary: The Apache Web Server Version 2.2 -AutoReqProv: on Provides: httpd http_daemon %{apache_mmn} suse_help_viewer Requires: %{pname}-MPM /etc/mime.types PreReq: %{name}-utils @@ -200,18 +204,14 @@ http://httpd.apache.org/docs-2.2/upgrading.html. %if %worker %package worker -License: ASLv.. Summary: Apache 2 worker MPM (Multi-Processing Module) -Group: Productivity/Networking/Web/Servers Provides: %{pname}-MPM Requires: %{name} = %{version} %endif %if %prefork %package prefork -License: ASLv.. Summary: Apache 2 "prefork" MPM (Multi-Processing Module) -Group: Productivity/Networking/Web/Servers Provides: %{pname}-MPM %if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9 Provides: apache:/usr/sbin/httpd @@ -221,18 +221,14 @@ Requires: %{name} = %{version} %if %event %package event -License: ASLv.. Summary: Apache 2 event MPM (Multi-Processing Module) -Group: Productivity/Networking/Web/Servers Provides: %{pname}-MPM Requires: %{name} = %{version} %endif %if %itk %package itk -License: ASLv.. Summary: Apache 2 "ITK" MPM (Multi-Processing Module) -Group: Productivity/Networking/Web/Servers Provides: %{pname}-MPM Requires: %{name} = %{version} %endif @@ -288,7 +284,6 @@ See http://mpm-itk.sesse.net/ %endif %package devel -License: ASLv.. Summary: Apache 2.2 Header and Include Files Group: Development/Libraries/C and C++ Requires: %{name} = %{version} %{pname}-MPM @@ -302,7 +297,6 @@ for development using the Apache API. %package doc -License: ASLv.. Summary: Additional Package Documentation. Group: Documentation/Other %if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9 @@ -320,9 +314,7 @@ this package's base documentation. %package example-pages -License: ASLv.. Summary: Example Pages for the Apache 2 Web Server -Group: Productivity/Networking/Web/Servers %if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9 Provides: apache-example-pages Obsoletes: apache-example-pages @@ -333,9 +325,7 @@ Some Example pages for Apache that show information about the installed server. %package utils -License: ASLv.. Summary: Apache 2 utilities -Group: Productivity/Networking/Web/Servers %description utils Utilities provided by the Apache 2 Web Server project which are useful From 3fdc7560a6197bbe34f94f17cb4c902c32ad15ace32816c265768f5112e7c7c2 Mon Sep 17 00:00:00 2001 From: Roman Drahtmueller Date: Mon, 12 Dec 2011 11:06:24 +0000 Subject: [PATCH 3/3] Accepting request 96234 from home:msmeissn:branches:Apache does not need openldap2 package, just openldap2-devel and libldap... OBS-URL: https://build.opensuse.org/request/show/96234 OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=352 --- apache2.changes | 5 +++++ apache2.spec | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apache2.changes b/apache2.changes index d92b85e..e13c514 100644 --- a/apache2.changes +++ b/apache2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Dec 10 10:34:26 CET 2011 - meissner@suse.de + +- openldap2 is not necessary, just openldap2-devel as buildrequires + ------------------------------------------------------------------- Fri Dec 2 07:18:56 UTC 2011 - coolo@suse.com diff --git a/apache2.spec b/apache2.spec index 14d95dd..df51ddf 100644 --- a/apache2.spec +++ b/apache2.spec @@ -15,13 +15,13 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: apache2 BuildRequires: automake BuildRequires: db-devel BuildRequires: ed BuildRequires: libapr-util1-devel BuildRequires: libapr1-devel >= 1.4.2 -BuildRequires: openldap2 BuildRequires: openldap2-devel BuildRequires: openssl-devel BuildRequires: pcre-devel @@ -74,8 +74,6 @@ BuildRequires: expat-devel # "Server:" header %define VENDOR SUSE %define platform_string Linux/%VENDOR -License: Apache-2.0 -Group: Productivity/Networking/Web/Servers %define realver 2.2.21 Version: 2.2.21 Release: 0 @@ -145,6 +143,8 @@ Patch106: httpd-2.2.x-CVE-2011-3368-server_protocl_c.diff Url: http://httpd.apache.org/ Icon: Apache.xpm Summary: The Apache Web Server Version 2.2 +License: Apache-2.0 +Group: Productivity/Networking/Web/Servers Provides: httpd http_daemon %{apache_mmn} suse_help_viewer Requires: %{pname}-MPM /etc/mime.types PreReq: %{name}-utils @@ -205,6 +205,7 @@ http://httpd.apache.org/docs-2.2/upgrading.html. %package worker Summary: Apache 2 worker MPM (Multi-Processing Module) +Group: Productivity/Networking/Web/Servers Provides: %{pname}-MPM Requires: %{name} = %{version} %endif @@ -212,6 +213,7 @@ Requires: %{name} = %{version} %package prefork Summary: Apache 2 "prefork" MPM (Multi-Processing Module) +Group: Productivity/Networking/Web/Servers Provides: %{pname}-MPM %if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9 Provides: apache:/usr/sbin/httpd @@ -222,6 +224,7 @@ Requires: %{name} = %{version} %package event Summary: Apache 2 event MPM (Multi-Processing Module) +Group: Productivity/Networking/Web/Servers Provides: %{pname}-MPM Requires: %{name} = %{version} %endif @@ -229,6 +232,7 @@ Requires: %{name} = %{version} %package itk Summary: Apache 2 "ITK" MPM (Multi-Processing Module) +Group: Productivity/Networking/Web/Servers Provides: %{pname}-MPM Requires: %{name} = %{version} %endif @@ -315,6 +319,7 @@ this package's base documentation. %package example-pages Summary: Example Pages for the Apache 2 Web Server +Group: Productivity/Networking/Web/Servers %if 0%{?suse_version} >= 901 && 0%{?sles_version} != 9 Provides: apache-example-pages Obsoletes: apache-example-pages @@ -326,6 +331,7 @@ server. %package utils Summary: Apache 2 utilities +Group: Productivity/Networking/Web/Servers %description utils Utilities provided by the Apache 2 Web Server project which are useful