From nobody@FreeBSD.org  Tue Sep  1 22:05:03 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B5ED1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Sep 2009 22:05:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 03F488FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Sep 2009 22:05:03 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n81M52C0010303
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 1 Sep 2009 22:05:02 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n81M52nf010302;
	Tue, 1 Sep 2009 22:05:02 GMT
	(envelope-from nobody)
Message-Id: <200909012205.n81M52nf010302@www.freebsd.org>
Date: Tue, 1 Sep 2009 22:05:02 GMT
From: Dmitry Pryanishnikov <lynx.ripe@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] 'rc.d/apache22 graceful' fails (WITH_OPENSSL_PORT=yes)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138466
>Category:       ports
>Synopsis:       [patch] www/apache22: 'rc.d/apache22 graceful' fails (WITH_OPENSSL_PORT=yes)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pgollucci
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 01 22:10:00 UTC 2009
>Closed-Date:    Fri Dec 11 23:43:34 UTC 2009
>Last-Modified:  Fri Dec 11 23:50:01 UTC 2009
>Originator:     Dmitry Pryanishnikov
>Release:        6.2-RELEASE
>Organization:
Home
>Environment:
FreeBSD test.homenet 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #0: Thu Aug 30 16:53:51 EEST 2007     dmitry@test.homenet:/usr/obj/usr/RELENG_6_2/src/sys/test  i386

>Description:
Script /usr/local/etc/rc.d/apache22 installed by www/apache22 port doesn't
source /usr/local/sbin/envvars for commands 'graceful' and 'gracefulstop'.
For apache built against OpenSSL from ports (WITH_OPENSSL_PORT=yes) _and_
when OpenSSL in base system is too old (like 0.9.8e in 6.2-RELEASE), this
causes fatal error during these commands execution, e.g.:

httpd: Syntax error on line 86 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/mod_ssl.so into server: /usr/local/libexec/apache22/mod_ssl.so: Undefined symbol "SSL_get_servername"

The apparent cause of the problem is that /usr/local/sbin/envvars defines
LD_LIBRARY_PATH to contain /usr/local/lib in front of it, so mod_ssl.so
uses correct libraries (for OpenSSL build from ports). Without this step,
mod_ssl.so uses incorrect libraries (from the base system).
>How-To-Repeat:
Build www/apache22 in 6.2-RELEASE with WITH_OPENSSL_PORT=yes, start it,
then issue /usr/local/etc/rc.d/apache22 graceful or gracefulstop.
>Fix:
The accompanying patch sources /usr/local/sbin/envvars in the
apache22_requirepidfile function, which is common for graceful and
gracefulstop operations.

Patch attached with submission follows:

--- apache22.in.orig	Tue Aug 25 14:41:13 2009
+++ apache22.in	Tue Sep  1 22:53:21 2009
@@ -130,6 +130,11 @@
 
 apache22_requirepidfile()
 {
+	if test -f /usr/local/sbin/envvars
+	then
+		. /usr/local/sbin/envvars
+	fi
+
 	if [ ! "0`check_pidfile ${pidfile} ${command}`" -gt 1 ]; then
 		echo "${name} not running? (check $pidfile)."
 		exit 1


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->apache 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Sep 2 09:37:50 UTC 2009 
Responsible-Changed-Why:  
Fix synopsis and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138466 
Responsible-Changed-From-To: apache->pgollucci 
Responsible-Changed-By: pgollucci 
Responsible-Changed-When: Thu Dec 10 10:35:35 UTC 2009 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138466 
State-Changed-From-To: open->closed 
State-Changed-By: pgollucci 
State-Changed-When: Fri Dec 11 23:43:33 UTC 2009 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138466 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/138466: commit references a PR
Date: Fri, 11 Dec 2009 23:43:34 +0000 (UTC)

 pgollucci    2009-12-11 23:43:26 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/apache22         Makefile 
     www/apache22/files   apache22.in 
   Log:
   - envvars needs to be sourced before _all_ commands if it exists
   
   PR:             ports/138466 (based on)
   Submitted by:   Dmitry Pryanishnikov <lynx.ripe@gmail.com>
   
   Revision  Changes    Path
   1.248     +1 -1      ports/www/apache22/Makefile
   1.6       +3 -1      ports/www/apache22/files/apache22.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
