From owner-svn-src-all@FreeBSD.ORG Sun Mar 13 14:46:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF91A106566B; Sun, 13 Mar 2011 14:46:10 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 49DC78FC18; Sun, 13 Mar 2011 14:46:10 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id A46DA1DD65F; Sun, 13 Mar 2011 15:46:09 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 97F89173AA; Sun, 13 Mar 2011 15:46:09 +0100 (CET) Date: Sun, 13 Mar 2011 15:46:09 +0100 From: Jilles Tjoelker To: Doug Barton Message-ID: <20110313144609.GA11779@stack.nl> References: <201103122113.p2CLD8LO030205@svn.freebsd.org> <20110312230830.GA269@stack.nl> <4D7C7CC9.7010901@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D7C7CC9.7010901@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219578 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2011 14:46:10 -0000 On Sun, Mar 13, 2011 at 12:14:01AM -0800, Doug Barton wrote: > On 03/12/2011 15:08, Jilles Tjoelker wrote: > > I wonder if it is a good idea to pollute the environment of many daemons > > with this. Although sshd and cron clean it up, there is at least one > > daemon that passes the environment on. One of those is devd. > I think the argument could be made that this is bad behavior on their > part, but if it turns out that it starts affecting things negatively we > can take another look at it. Cleaning the environment requires special care to preserve environment variables that may still be needed. This is a problem particularly for code intended to be portable. Perhaps someone wants to apply a hack using LD_PRELOAD or other LD_* variables, or an environment variable is needed to force standards-compliant behaviour that the program depends on. The service(8) utility should clear the environment so it matches the boot environment as much as possible. If someone wants to set special environment variables, they should configure that in such a way that it also works at boot or call the rc.d script directly. > > While that > > saves four /etc/rc.conf reads on my minimalistic 9-current VM, it > > implies that devd must be restarted to pick up changes to /etc/rc.conf. > > That seems a POLA violation. > I'm not sure what you mean by this. We've always required services to be > restarted to pick up rc.conf changes. For options for devd itself, yes. However, as configured in the default /etc/devd.conf, devd may invoke commands like /etc/pccard_ether $subsystem start or /etc/rc.d/dhclient quietstart $subsystem The natural expectation is that these reread /etc/rc.conf every time, so that it is possible to set up network settings for a network interface and then plug it in, without restarting devd. And so it worked before r219578. Also, consider the case where settings are changed in /etc/rc.conf and then applied by manual running of rc.d scripts. With the new code, unplugging and replugging the device, triggering devd, reverts the settings to their boot-time values. Another unexpected result may occur if /etc/rc.conf.d/devd modifies a variable defined in /etc/defaults/rc.conf or /etc/rc.conf. The change will now apply to everything started by devd as well, different from former behaviour. This is not that likely for devd as it has few defined variables, but may affect other daemons and also affects running an rc.d script from another via run_rc_script. -- Jilles Tjoelker