svn commit: r219578 - head/etc

John Baldwin jhb at freebsd.org
Mon Mar 14 12:59:32 UTC 2011


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


More information about the svn-src-all mailing list