From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Sep 1 12:40:19 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97B8A16A41F for ; Thu, 1 Sep 2005 12:40:19 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA84843D48 for ; Thu, 1 Sep 2005 12:40:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j81CeI7H023808 for ; Thu, 1 Sep 2005 12:40:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j81CeIF4023803; Thu, 1 Sep 2005 12:40:18 GMT (envelope-from gnats) Resent-Date: Thu, 1 Sep 2005 12:40:18 GMT Resent-Message-Id: <200509011240.j81CeIF4023803@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jarrod Sayers Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87D6E16A41F for ; Thu, 1 Sep 2005 12:32:40 +0000 (GMT) (envelope-from jarrod@manhattan.netleader.com.au) Received: from manhattan.netleader.com.au (manhattan.netleader.com.au [210.11.55.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D84E43D45 for ; Thu, 1 Sep 2005 12:32:39 +0000 (GMT) (envelope-from jarrod@manhattan.netleader.com.au) Received: from manhattan.netleader.com.au (localhost [127.0.0.1]) by manhattan.netleader.com.au (8.13.1/8.13.1) with ESMTP id j81CWTvF032663; Thu, 1 Sep 2005 22:02:29 +0930 (CST) (envelope-from jarrod@manhattan.netleader.com.au) Received: (from jarrod@localhost) by manhattan.netleader.com.au (8.13.1/8.13.1/Submit) id j81CWSjY032662; Thu, 1 Sep 2005 22:02:28 +0930 (CST) (envelope-from jarrod) Message-Id: <200509011232.j81CWSjY032662@manhattan.netleader.com.au> Date: Thu, 1 Sep 2005 22:02:28 +0930 (CST) From: Jarrod Sayers To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/85566: [patch] Correction to allow for restart/reload of www/apache2 when using apache2_profiles X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jarrod Sayers List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2005 12:40:19 -0000 >Number: 85566 >Category: ports >Synopsis: [patch] Correction to allow for restart/reload of www/apache2 when using apache2_profiles >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 01 12:40:18 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Jarrod Sayers >Release: FreeBSD 4.11-RELEASE-p11 i386 >Organization: >Environment: System: FreeBSD manhattan.netleader.com.au 4.11-RELEASE-p11 FreeBSD 4.11-RELEASE-p11 #21: Sun Jul 3 15:43:12 CST 2005 root@manhattan.netleader.com.au:/usr/obj/usr/src/sys/MANHATTAN i386 Port: www/apache2 $FreeBSD: ports/www/apache2/Makefile,v 1.225 2005/08/25 20:24:52 clement Exp $ $FreeBSD: ports/www/apache2/files/apache.sh,v 1.13 2005/06/01 17:49:31 clement Exp $ >Description: When www/apache2 is configured to use profiles, the ability to use the restart and reload directives is lost due to an issue with apache.sh which is installed as /usr/local/etc/rc.d/apache2.sh and the way the syntax check is performed. When attempting a restart or reload, the following error is generated (and no reload): manhattan# /usr/local/etc/rc.d/apache2.sh reload ===> apache2 profile: httpd171 Reloading apache2 config files. Performing sanity check on apache2 configuration: Usage: /usr/local/sbin/httpd [-D name] [-d directory] [-f file] [-C "directive"] [-c "directive"] [-k start|restart|graceful|stop] [-v] [-V] [-h] [-l] [-L] [-t] [-S] [~ much noice about command line arguments ~] ===> apache2 profile: httpd172 Reloading apache2 config files. Performing sanity check on apache2 configuration: Usage: /usr/local/sbin/httpd [-D name] [-d directory] [-f file] [-C "directive"] [-c "directive"] [-k start|restart|graceful|stop] [-v] [-V] [-h] [-l] [-L] [-t] [-S] [~ much noice about command line arguments ~] manhattan# The start and stop directives are performed by routines in rc.subr and using a 'set -x' on the shell script, the process is started as follows: + eval /usr/local/sbin/httpd -f /usr/local/etc/apache2/httpd172.conf -c "PidFile /var/run/httpd.httpd172.pid" + /usr/local/sbin/httpd -f /usr/local/etc/apache2/httpd172.conf -c PidFile /var/run/httpd.httpd172.pid + _return=0 However the restart and reload directives are performed by the apache2.sh script resulting in: + echo Performing sanity check on apache2 configuration: Performing sanity check on apache2 configuration: + /usr/local/sbin/httpd -f /usr/local/etc/apache2/httpd172.conf -c "PidFile /var/run/httpd.httpd172.pid" -t Usage: /usr/local/sbin/httpd [-D name] [-d directory] [-f file] I believe the error is caused by the addition of the -c argument (more importantly, the requirement for the quotes) to override the location of the pid file regardless of the one defined within the configuration file. >How-To-Repeat: Install www/apache2 from ports:` manhattan# cd /usr/ports/www/apache2 manhattan# make install clean Add lines to /etc/rc.conf to enable apache2 profiles (use would normally be for more than one profile but apache2_profiles can be used to start a single httpd process to confirm the error): apache2_enable="YES" apache2_profiles="httpd" apache2_httpd_configfile="/usr/local/etc/apache2/httpd.conf" >Fix: Eval'ing the command performing the sanity checks corrects the error (and mimics a standard start procedure) allowing for restart and reload ability regardless of the use of profiles. (Very simple) diff provided below: --- ports/www/apache2/files/apache.sh.orig Fri Jul 1 19:49:58 2005 +++ ports/www/apache2/files/apache.sh Mon Aug 29 15:32:12 2005 @@ -93,7 +93,7 @@ apache2_checkconfig() { echo "Performing sanity check on apache2 configuration:" - ${command} ${apache2_flags} -t + eval ${command} ${apache2_flags} -t } apache2_precmd() >Release-Note: >Audit-Trail: >Unformatted: