From owner-freebsd-current@FreeBSD.ORG Mon Nov 26 18:22:26 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5942B34F; Mon, 26 Nov 2012 18:22:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx1.freebsd.org (Postfix) with ESMTP id AFC768FC15; Mon, 26 Nov 2012 18:22:25 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id hm9so3155202wib.13 for ; Mon, 26 Nov 2012 10:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=kCMgskCNE9+Z7AAuMsUypNaIqi9oQYgTFHyigan6Fa8=; b=V7/WzyGdP58lSxkaCUW+1NOHAA7Ml6+hwkh1M5HvBJV4VtOv+0zyrYU1He1u7868p7 A4pXqrm0m6FH0GHqAdOvPTSRgK42VotNMLafDsHDmEJ68z3kODtCYSaTlu71SagR4Nu4 67g7cG1Mww+i1UbLcuX6TCxA8pL404wE13fwDNzOiECaC9Jhem16OIj4ONau5EE6VKzw ULItccNqG1zu51znm0H80Xn3fhVinliPl35JmjM9wsSmyysV4iXHrDjEBQHOaYvo4PT7 1p9ni5D7g0QvozatS6KwXKiUsc0buJNPq8YzAzEe59pDEHQtMKADrlk4+03A3GR6zsGh u+Hw== Received: by 10.180.74.108 with SMTP id s12mr19218512wiv.12.1353954143931; Mon, 26 Nov 2012 10:22:23 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id bz12sm127354wib.5.2012.11.26.10.22.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 10:22:22 -0800 (PST) Date: Mon, 26 Nov 2012 19:22:14 +0100 From: Mateusz Guzik To: freebsd-rc@FreeBSD.org Subject: Re: after upgrade, can't restart apache via cron Message-ID: <20121126182214.GA17080@dft-labs.eu> References: <20121123031753.GA59632@bewilderbeast.blackhelicopters.org> <20121123.233754.1596631883684484110.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20121123.233754.1596631883684484110.hrs@allbsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: current@FreeBSD.org, mwlucas@michaelwlucas.com X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 18:22:26 -0000 On Fri, Nov 23, 2012 at 11:37:54PM +0900, Hiroki Sato wrote: > "Michael W. Lucas" wrote > in <20121123031753.GA59632@bewilderbeast.blackhelicopters.org>: > > mw> eval: setfib: not found > mw> /usr/local/etc/rc.d/apache22: WARNING: failed to start apache22 > mw> > mw> If I run /usr/local/etc/rc.d/apache22 restart from the command line, I > mw> can restart httpd without trouble. > mw> > mw> Any thoughts? > > This was due to $PATH in the cron job as already pointed out, but > this should not happen. I attached a patch to use full-path for > external commands in rc.subr. If there is no objection to this > change I will commit it. > service(8) tries to sanitize stuff before executing scripts. How about making this the default behaviour? Currently stuff like PATH "leak" to rc scripts and this can be harmful (for instance daemon was happily executing stuff from /usr/local/bin, yet after reboot it stopped working). Also I doubt anyone relies on current environment and what not to start a service, but we can provide another target tha would start the service without sanitizing in case this is needed. -- Mateusz Guzik