Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Mar 2011 08:08:14 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton <dougb@freebsd.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r219578 - head/etc
Message-ID:  <201103140808.15076.jhb@freebsd.org>
In-Reply-To: <20110313144609.GA11779@stack.nl>
References:  <201103122113.p2CLD8LO030205@svn.freebsd.org> <4D7C7CC9.7010901@FreeBSD.org> <20110313144609.GA11779@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, March 13, 2011 10:46:09 am Jilles Tjoelker wrote:
> 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.

I agree that this is the behavior that I certainly expect.  I also agree that 
it is hard to safely purge environment variables in all of the system daemons.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103140808.15076.jhb>