gdm should not use locale settings from /etc/environment

Bug #160984 reported by Henning Moll on 2007-11-08
36
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdm (Ubuntu)
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gdm

Interesting part from /usr/share/doc/belocs-locales-bin/NEWS.Debian.gz:

> * Locale variables are now stored in /etc/default/locale and no more
> /etc/environment. The reason is that Debian Policy forbids modifying
> configuration files of other packages, and /etc/environment is a
> configuration file for PAM.

locales should not be stored there, but this is still neccessary (e.g. for gdm).
Then it says:

> Make sure to remove old definitions from /etc/environment, this file
> is no more modified for the reason explained above.

if i follow that advise, gnome starts with a "C" locale setting, but not the one which is defined in /etc/default/locale.
But then i dont' understand the comments from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=389466
> * Parse /etc/default/locale in gdm pam files, for now (closes: #389466)

Changed in gdm:
assignee: nobody → desktop-bugs
importance: Undecided → Low
Sebastien Bacher (seb128) wrote :

Thank you for your bug. Where is this file used exactly? Could you describe what is your issue?

Changed in gdm:
status: New → Incomplete
Henning Moll (drscott) wrote :

Ubuntu is a derivative of Debian. Therefore i think Ubuntu is somehow bound to design desicions made in Debian. They say:

> [...] Debian Policy forbids modifying
> configuration files of other packages, and /etc/environment is a
> configuration file for PAM.

and

> Locale variables are now stored in /etc/default/locale and no more
> /etc/environment.
> Make sure to remove old definitions from /etc/environment, this file
> is no more modified for the reason explained above.

Now the problem is, that the gdm of gutsy is still looking for LANG in /etc/environment. (Even if LANG is not defined there, gdm does _not_ look in /etc/default/locale.)

As i (seem to) understand now, the bug report i quoted above is a different thing. But do i misunderstand the content of file /usr/share/doc/belocs-locales-bin/NEWS.Debian.gz? Programms should no longer store their variables in configuration files of other packages. It is also advised to remove LANG from /etc/environment, which - at least in gutsy - does not work: You end up with a non-localized gnome desktop. So, is this a breach of the debian policy? Is this ok for ubuntu? Is the debian policy just political or also technical? Do i miss something?

Hope you see my point ;-)

Henning Moll (drscott) wrote :

See also Bug #77983

Sebastien Bacher (seb128) wrote :

where is the environment configuration used? instead of describing what debian is doing could you indicate what code is concerned?

That's what ubuntu is using

"if [ -r /etc/environment ]; then
  if LANG=$(pam_getenv -l LANG); then
    export LANG
  fiif [ -r /etc/environment ]; then
  if LANG=$(pam_getenv -l LANG); then
    export LANG
  fi
  if LANGUAGE=$(pam_getenv -l LANGUAGE); then
    export LANGUAGE
  fi

fi

  if LANGUAGE=$(pam_getenv -l LANGUAGE); then
    export LANGUAGE
  fi

fi"

which means pam_getenv is used, is that your issue?

Sebastien Bacher (seb128) wrote :

"if [ -r /etc/environment ]; then
  if LANG=$(pam_getenv -l LANG); then
    export LANG
  fi
  if LANGUAGE=$(pam_getenv -l LANGUAGE); then
    export LANGUAGE
  fi

fi
"

Henning Moll (drscott) wrote :

Yes, you are right, that is the issue. The code from your last posting should look like this:

if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

This is the code used since etch.

Sebastien Bacher (seb128) wrote :

The code is using pam_getenv, do you think that the tool is buggy? Could you describe a situation where the system is behaving incorrectly, what you do, what happens and what else you would expect? The language selector also uses environment which is coherent

Henning Moll (drscott) wrote :

The problem ist, that at the moment it is neccessary to have the locale definition in two different places:

/etc/environment
/etc/default/locale

This is redundant and confusing.

the first is used by gdm (and therefore for the whole gnome-session), for example.
the later is used by /etc/pam.d/login (in addition to /etc/environment, but /etc/default/locale wins). If you login in a tty, for example.

So the problem is, that LANG has to be adjusted in both places to successfully switch from one locale to another.

Now, that debian policy says not to use /etc/environmnt all programms should use /etc/default/locale instead, shouldn't they?

Changed in gdm:
status: Incomplete → New
Sebastien Bacher (seb128) wrote :

the bug has been fixed in hardy

Changed in gdm:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers