Comment 13 for bug 1662031

Olivier Tilloy (osomon) wrote :

/etc/pam.d/gdm-launch-environment is run as user gdm, so it's not what we're interested in.

/etc/pam.d/gdm-password appears to be what sets the environment upon user login.

When adding some logging to that module, I'm seeing the following:

pam_env(gdm-password:session): username=ubuntu
pam_env(gdm-password:session): user env path: /home/ubuntu/.pam_environment
pam_env(gdm-password:session): parsing config file
pam_env(gdm-password:session): remove variable "LANGUAGE=fr_FR:en_GB:en"
pam_env(gdm-password:session): remove variable "LANG=fr_FR.UTF-8"

It turns out, "VARIABLE=value" is not the correct syntax for ~/.pam_environment. The expected syntax is "VARIABLE [DEFAULT=[value]] [OVERRIDE=[value]]" (man pam_env.conf).
And indeed if I modify ~/.pam_environment to conform to that syntax, I'm seeing this instead:

pam_env(gdm-password:session): pam_putenv("LANGUAGE=fr_FR:en_GB:en")
pam_env(gdm-password:session): pam_putenv("LANG=fr_FR.UTF-8")

That doesn't seem to fix the overall issue though, as the values of LANGUAGE and LANG are still those from /etc/default/locale after logging in.