[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#133578: gdm bug #133578. Intend to NMU.

On Wed, Apr 21, 2004 at 10:10:04PM -0500, Steve Langasek wrote:
> On Wed, Apr 21, 2004 at 12:31:28PM +0200, Andreas Metzler wrote:
> > Calum Mackay <calum.mackay@cdmnet.org> wrote:
> > > If /etc/environment is to be limited to PAM, shouldn't that be made 
> > > clear in its name, or its comments?
> > > Mine contains:
> > >        GDK_USE_XFT=1
> > >        LANG=en_GB
> > > neither of which seem particular PAM-related.
> > [...]
> > Neither of which need to be.
> > /etc/environment is not some configuration file for mysthical PAM
> > internals but a place to set *arbitrary* environment variables for
> > all sessions using pam_env, including ssh, login, xdm, ...
> And this is precisely why it shouldn't be used for pushing values into
> the environment of gdm -- its purpose (as documented and implemented
> by the system) is to set environment variables for *user sessions* once
> the user has authenticated, not to set env vars for arbitrary processes
> that are not related to user sessions (such as the gdm greeter).

Well, it is modeled after AIX, but the linux implementation must have
forgotten that it isn't just for user sessions but for all processes.
I quote from

  The /etc/environment file contains variables specifying the basic
  environment for all processes. When a new process begins, the exec
  subroutine makes an array of strings available that have the form
  Name=Value. This array of strings is called the environment. Each
  name defined by one of the strings is called an environment variable
  or shell variable. The exec subroutine allows the entire environment
  to be set at one time.

  Environment variables are examined when a command starts
  running. The environment of a process is not changed by altering the
  /etc/ environment file. Any processes that were started prior to the
  change to the /etc/environment file must be restarted if the change
  is to take effect for those processes. If the TZ variable is
  changed, the cron daemon must be restarted, because this variable is
  used to determine the current local time.

Perhaps the documentation for /etc/environment on Linux should be
changed to say that "The /etc/environment file contains variables
specifying the basic environment for all processes"?  I see no point
in coming up with a new way to create a file for global environment
settings when /etc/environment already can and parhaps even is
expected to do that.

Reply to: