From owner-freebsd-apache@FreeBSD.ORG Wed Sep 4 18:27:34 2013 Return-Path: Delivered-To: apache@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 34357AA8 for ; Wed, 4 Sep 2013 18:27:34 +0000 (UTC) (envelope-from ohauer@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A85512A6B for ; Wed, 4 Sep 2013 18:27:33 +0000 (UTC) Received: from [192.168.0.100] ([87.139.233.65]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0M1Fe4-1WALIR01eK-00t8Sz for ; Wed, 04 Sep 2013 20:27:31 +0200 Message-ID: <52277B92.40508@gmx.de> Date: Wed, 04 Sep 2013 20:27:30 +0200 From: olli hauer User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: www/apache22/files/patch-support__apachectl.in change in r322368 References: <522757BF.60300@FreeBSD.org> In-Reply-To: <522757BF.60300@FreeBSD.org> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=x-viet-vps Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:al0K+beXy/TTHJGnQrvW5N9yTpaobpuIn6o9u4hl8ahrQKb5R2Q rjluRxwG9rtvuM0aGDbtt+lvmU9pUMCy/zUmn5dZiseYjwMdrsfBf0uGPPAOWPHuiRYhnex zSmwB2etVurNv+E7dS4f3xxEHE8c03mivbCDQX9ESQwvVocNYNRL2F9710Yn8x56yvTzDA0 GuF4w4IOsI1o4qz5jI75g== Cc: apache@FreeBSD.org X-BeenThere: freebsd-apache@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Support of apache-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Sep 2013 18:27:34 -0000 On 2013-09-04 17:54, Andriy Gapon wrote: > > http://svnweb.freebsd.org/ports?view=revision&revision=322368 > Commit message says: > - add fix for CVE-2013-1862 > - adjust vuxml > > At the same time there is the following change to patch-support__apachectl.in: > +-case $ARGV in > +-start|stop|restart|graceful|graceful-stop) > +- $HTTPD -k $ARGV > ++case $ACMD in > ++start|stop|restart|rcvar|reload|graceful|gracefulstop|graceful-stop) > ++# $HTTPD -k $ARGV > ++ $SERVICE $( echo $ACMD | tr -d '-' ) > + ERROR=$? > + ;; > > Of particular interest to me is this change from direct start of httpd to > starting via service(8) command. > There is no rationale for this change in commit message... > > Now I will describe a problem that this changes causes for us. > Among other things we use piped loggers with apache. Our filter commands need > custom PATH to be specified for them. Basically they start with: > #!/usr/bin/env blah-blah > And finding blah depends on the proper PATH. > We are careful to set PATH before running apachectl. Everything used to work > without any glitch. > > Now, service(8) does the following: > exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script $* > This obviously nullifies any effects of our PATH customization. > Our configuration became broken. > > Do you have any suggestions on how we can work around the problem? > > Another minor consequence of this change is that now apache22_enable="YES" must > be set to start httpd even via apachectl. Previously it didn't have to be > specified. > And unlike rc.d/apache22 which accepts onestart/forcestart as all rc scripts do, > apachectl rejects these commands. > > So, I think that the change: > - was not appropriately committed but rather sneaked into another change > - is a POLA violation > - is a PITA > > So, perhaps you could consider reverting it? > > Thank you very much for all the hard work on apache ports. > Hope that you will be able to help to resolve the reported issues. > Hm, starting apache with a clean environment was one of the intention behind this change. In any case you don't want apache to sucks in the environment from the user starting the server via apachectl. The clean way will be to place the custom vars in apache22/24/envars.d this way cat apache22/envvars.d/foo.env export FOO=BAR export ILOVE=FreeBSD ... The name of the file doesn't matter as long as it ends with '.env', then it will be processed by the $LOCALBASE/sbin/envvars script. Hope this helps. -- Regards, olli