Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#735265: lightdm-gtk-greeter: Language of previous session is not used

200 views
Skip to first unread message

Simon Pepping

unread,
Jan 14, 2014, 4:40:01 AM1/14/14
to
Package: lightdm-gtk-greeter
Version: 1.6.1-5
Severity: normal
Tags: l10n

Dear Maintainer,

When I select my language once in the language selector, I want to be
logged in with that language on all subsequent log-ins, until I select
another language in the language selector. That does not happen. I am
always logged with the language of the system-wide locale, unless I
select a language in the language selector.

My language setting in ~/.xsessionrc is overwritten. Ideally, the
language selector would have a option which leaves the setting in such
a script unmodified.

* What led up to the situation?

I select english in the language selector and log in. Language is
english. I log out.

I make no selection in the language selector and log in. Language is
dutch.

* What outcome did you expect instead?

I expect that subsequent log-ins use the earlier selected language,
i.e. english in my case.

Note that the locale setting below is the result of logging in with
english as the selected language.

-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.12-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lightdm-gtk-greeter depends on:
ii libc6 2.17-97
ii libcairo2 1.12.16-2
ii libgdk-pixbuf2.0-0 2.28.2-1+b1
ii libglib2.0-0 2.36.4-1
ii libgtk-3-0 3.8.6-1
ii liblightdm-gobject-1-0 1.8.5-3
ii libx11-6 2:1.6.2-1

Versions of packages lightdm-gtk-greeter recommends:
ii desktop-base 7.0.3
ii gnome-icon-theme-symbolic 3.10.1-1
pn gnome-themes-standard <none>
ii policykit-1 0.105-4

lightdm-gtk-greeter suggests no packages.

-- Configuration Files:
/etc/lightdm/lightdm-gtk-greeter.conf changed:
[greeter]
background=/usr/share/images/desktop-base/login-background.svg
theme-name=Adwaita
xft-antialias=true
xft-hintstyle=hintfull
xft-rgba=rgb


-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Yves-Alexis Perez

unread,
Jan 14, 2014, 12:10:02 PM1/14/14
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Note: I'm replying to both bugs at once because they look quite the
same. I'm not merging them right now because that's not completely sure
either.

On Tue, Jan 14, 2014 at 12:40:01PM +0900, Olaf Meeuwissen wrote:
> Package: lightdm
> Version: 1.8.5-3
> Severity: normal
>
> Dear Maintainer,
>
> I have seen #690899, #691446 and #733261 but feel that my issue is not
> quite the same. Hence a separate bug report.
>
> I have a few locale tweaks in my ~/.xsessionrc (following comments found
> in /etc/X11/Xsession.d/40x11-common_xsessionrc). The relevant bit of my
> customizations:
>
> export LANG=ja_JP.UTF-8
> export LC_MESSAGES=en_GB.UTF-8
> export LANGUAGE=${LC_MESSAGES}
>
> This has been working great for me for several years. After the recent
> upgrade of lightdm (from 1.6.3-1) the LANG setting got clobbered to the
> first enabled locale, i.c. aa_DJ.UTF-8, whereas the system default is C.
>
> The system default locale and enabled locales have not been changed in
> a long time, nor has my .xsessionrc. What might have played a role
> was me removing my ~/.dmrc at about the same point as the upgrade as
> part of a dot-file cleanup. Changing its Language setting to the same
> value as the LANG setting in my ~/.xsessionrc fixed things for me.
>
> I would expect the preselected locale for lightdm's locale selector to
> be the system default (or whatever is configured explicitly for that bit
> of lightdm functionality), not whichever of the enabled locales is
> listed first in /etc/locale.gen.

Yeah, that's not really optimal indeed. Actually that's the case only
for the first startup after boot, and before an user is selected.

> The system default would then become
> the user's locale if a user does not have a ~/.dmrc file. Also, I would
> expect any tweaks in a user's ~/.xsessionrc to take effect/precedence
> and not be clobbered by any locale functionality courtesy of lightdm.
>
> That is to say, I would expect my LANG setting in ~/.xsessionrc to take
> precedence over whatever is (or ends up) in ~/.dmrc. If I have nothing
> in my ~/.xsessionrc, I expect to end up with what is configured in
> /etc/default/locale.

Well that should be the case, actually.

The lightdm greeter will select a locale based on .dmrc if it exists,
but if the user chose another one in the menu, then it'll use that for
LANG. Then, at login, /etc/X11/Xsession is run, which in turns run-parts
the scripts in /etc/X11/Xsession.d and especially
40x11-common_xsessionrc, so whatever you put in .xsessionrc will take
precedence over previously set variables (and independantly of lightdm)

I repeat, by the time .xsessionrc is parsed, lightdm or the greeter
doesn't have a chance to do anything to modify the locale anymore.

On Tue, Jan 14, 2014 at 10:32:13AM +0100, Simon Pepping wrote:
> Package: lightdm-gtk-greeter
> Version: 1.6.1-5
> Severity: normal
> Tags: l10n
>
> Dear Maintainer,
>
> When I select my language once in the language selector, I want to be
> logged in with that language on all subsequent log-ins, until I select
> another language in the language selector. That does not happen. I am
> always logged with the language of the system-wide locale, unless I
> select a language in the language selector.
>
> My language setting in ~/.xsessionrc is overwritten. Ideally, the
> language selector would have a option which leaves the setting in such
> a script unmodified.

As said above, that's the case. Also, I repeat, .xsessionrc and the
locale chooser in the lightdm greeters are *completely* unrelated, so
it's best to separate the test cases. .xsessionrc variables will
override whatever you set in the locale chooser, and you're then
responsible for the behavior.
>
> * What led up to the situation?
>
> I select english in the language selector and log in. Language is
> english. I log out.
>
> I make no selection in the language selector and log in. Language is
> dutch.
>
> * What outcome did you expect instead?
>
> I expect that subsequent log-ins use the earlier selected language,
> i.e. english in my case.
>
> Note that the locale setting below is the result of logging in with
> english as the selected language.
>

In the end, I'm pretty confused by those two bug reports. It seems that
people are indeed confused by the lightdm/lightdm-gtk-greeter behavior
wrt. locales, but the reports I get are merely adding confusion, not
helping to reduce it.

In order to detect issues in LightDM/lightdm-gtk greeter, it'd help to:

- - not set anything locale related in .xsessionrc (since it'll just
override whatever lightdm set)
- - provide the full output of `locales' (and maybe the content of
$LANGUAGE too)

Regards,
- --
Yves-Alexis Perez
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBCgAGBQJS1Ww8AAoJEG3bU/KmdcCljv0H/344AH1xgEDGsn0Q88l1Y+4o
Jh02LahMnh2Pz8QNuxEuWL0/lZCD2M9obMkGq5voZ3dR3fONngg69HTmgD3s1Lc+
E4IpZlbHPHra5dCL5TdUT7wKJD5ynLuMcEUqbJVCNrUnCWtygrwqhPn2G9bd1PhY
IWqWksj0Sgb8OOenaTofGuXyW9m36Lb1nRAC+KZzDvz84T3Sbuy3LpSrF3s+WhUo
TnzNzBA3ElKzZlI4VNhzCDOksGHQr3uRlUDM4YyyM6dC5jg+2Dk20rRqJbo9Jd4l
iyndPbCHAxv14TqXSz1yedFmtr+EcJZ/ohsc5FsqAgbIEprjkjez0+1Fahofu6E=
=EBKG
-----END PGP SIGNATURE-----

Simon Pepping

unread,
Jan 14, 2014, 2:50:01 PM1/14/14
to
On Tue, Jan 14, 2014 at 05:56:32PM +0100, Yves-Alexis Perez wrote:
> Note: I'm replying to both bugs at once because they look quite the
> same. I'm not merging them right now because that's not completely sure
> either.

The .xsessionrc problem is shared by both. I use the language
selector. It is not clear whether the other bug report does so.

> In the end, I'm pretty confused by those two bug reports. It seems that
> people are indeed confused by the lightdm/lightdm-gtk-greeter behavior
> wrt. locales, but the reports I get are merely adding confusion, not
> helping to reduce it.

Indeed, the two reports seem to contradict each other in some respects.

> In order to detect issues in LightDM/lightdm-gtk greeter, it'd help to:
>
> - not set anything locale related in .xsessionrc (since it'll just
> override whatever lightdm set)
> - provide the full output of `locales' (and maybe the content of
> $LANGUAGE too)

Trying to do that; this is my report:

/etc/default/locale:

# File generated by update-locale
LANG=nl_NL.UTF-8
#LANGUAGE="en_GB:en"

locale -a:

C
C.UTF-8
en_US.utf8
nl_NL.utf8
POSIX

locale (in the terminal shell, no X; this is the system-wide locale):

LANG=nl_NL.UTF-8
LANGUAGE=
LC_CTYPE="nl_NL.UTF-8"
LC_NUMERIC="nl_NL.UTF-8"
LC_TIME="nl_NL.UTF-8"
LC_COLLATE="nl_NL.UTF-8"
LC_MONETARY="nl_NL.UTF-8"
LC_MESSAGES="nl_NL.UTF-8"
LC_PAPER="nl_NL.UTF-8"
LC_NAME="nl_NL.UTF-8"
LC_ADDRESS="nl_NL.UTF-8"
LC_TELEPHONE="nl_NL.UTF-8"
LC_MEASUREMENT="nl_NL.UTF-8"
LC_IDENTIFICATION="nl_NL.UTF-8"
LC_ALL=

Session selection in lightdm greeter: xfce-session. Upon logout I do
not save the session.

The locales below were obtained in emacs in XFCE, thus excluding bash
startup files, even though these do not contain locale settings.

The following tests were done without ~/.xsessionrc.

Test 1. Log in without changing the language in the language selector:

locale (this is the system-wide locale):

LANG=nl_NL.utf8
LANGUAGE=
LC_CTYPE="nl_NL.utf8"
LC_NUMERIC="nl_NL.utf8"
LC_TIME="nl_NL.utf8"
LC_COLLATE="nl_NL.utf8"
LC_MONETARY="nl_NL.utf8"
LC_MESSAGES="nl_NL.utf8"
LC_PAPER="nl_NL.utf8"
LC_NAME="nl_NL.utf8"
LC_ADDRESS="nl_NL.utf8"
LC_TELEPHONE="nl_NL.utf8"
LC_MEASUREMENT="nl_NL.utf8"
LC_IDENTIFICATION="nl_NL.utf8"
LC_ALL=

~/.dmrc:

[Desktop]
Language=nl_NL.utf8
Session=xfce

Test 2. Log in with changing the language in the language selector to
english - USA:

locale:

LANG=en_US.utf8
LANGUAGE=
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

~/.dmrc

[Desktop]
Language=en_US.utf8
Session=xfce

Test 3. Log in without changing the language in the language selector:

locale:

LANG=nl_NL.utf8
LANGUAGE=
LC_CTYPE="nl_NL.utf8"
LC_NUMERIC="nl_NL.utf8"
LC_TIME="nl_NL.utf8"
LC_COLLATE="nl_NL.utf8"
LC_MONETARY="nl_NL.utf8"
LC_MESSAGES="nl_NL.utf8"
LC_PAPER="nl_NL.utf8"
LC_NAME="nl_NL.utf8"
LC_ADDRESS="nl_NL.utf8"
LC_TELEPHONE="nl_NL.utf8"
LC_MEASUREMENT="nl_NL.utf8"
LC_IDENTIFICATION="nl_NL.utf8"
LC_ALL=

~/.dmrc:

[Desktop]
Language=nl_NL.utf8
Session=xfce

Test 4. Log in with changing the language in the language selector to
english - USA (just to select english for the next test):

locale:

LANG=en_US.utf8
LANGUAGE=
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

~/.dmrc:

[Desktop]
Language=en_US.utf8
Session=xfce

Test 5:

Restore ~/xsessionrc:

# . /etc/profile
# . ~/.bash_profile

LANG="en_US.UTF-8"
export LC_MONETARY="nl_NL.UTF-8"
export LC_PAPER="nl_NL.UTF-8"
export LC_MEASUREMENT="nl_NL.UTF-8"
export LC_TIME="nl_NL.UTF-8"
export LC_NAME="nl_NL.UTF-8"
export LC_ADDRESS="nl_NL.UTF-8"
export LC_TELEPHONE="nl_NL.UTF-8"
export LC_IDENTIFICATION="nl_NL.UTF-8"
export LANGUAGE=en

Log in without changing the language in the language selector:

LANG=nl_NL.utf8
LANGUAGE=en
LC_CTYPE="nl_NL.utf8"
LC_NUMERIC="nl_NL.utf8"
LC_TIME=nl_NL.UTF-8
LC_COLLATE="nl_NL.utf8"
LC_MONETARY=nl_NL.UTF-8
LC_MESSAGES="nl_NL.utf8"
LC_PAPER=nl_NL.UTF-8
LC_NAME=nl_NL.UTF-8
LC_ADDRESS=nl_NL.UTF-8
LC_TELEPHONE=nl_NL.UTF-8
LC_MEASUREMENT=nl_NL.UTF-8
LC_IDENTIFICATION=nl_NL.UTF-8
LC_ALL=

~/.dmrc:

[Desktop]
Language=nl_NL.utf8
Session=xfce

Snippet from ~/.xsession-errors from this session (probably unrelated):

Xsession: X session started for simon at di jan 14 20:16:10 CET 2014

(xfce4-session:11083): xfce4-session-WARNING **: Unable to launch "update-notifier" (specified by autostart/update-notifier.desktop): Failed to execute child process "update-notifier" (No such file or directory)

From the process list of this session:

2554 ? SLl 0:00 /usr/sbin/lightdm
10968 tty7 Ss+ 0:17 \_ /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
11000 ? Sl 0:00 \_ lightdm --session-child 12 71
11020 ? Ss 0:00 \_ /bin/sh /etc/xdg/xfce4/xinitrc -- /etc/X11/xinit/xserverrc

Yves-Alexis Perez

unread,
Jan 14, 2014, 3:30:02 PM1/14/14
to
On Tue, Jan 14, 2014 at 08:43:30PM +0100, Simon Pepping wrote:
> Trying to do that; this is my report:

Thanks.

> The locales below were obtained in emacs in XFCE, thus excluding bash
> startup files, even though these do not contain locale settings.

I think I'd have prefered in bash, but I assume you're definitely sure
emacs doesn't gets in the way.

>
> The following tests were done without ~/.xsessionrc.

Ok.
>
> Test 1. Log in without changing the language in the language selector:
>
> locale (this is the system-wide locale):
>
> LANG=nl_NL.utf8
> LANGUAGE=
> LC_CTYPE="nl_NL.utf8"
> LC_NUMERIC="nl_NL.utf8"
> LC_TIME="nl_NL.utf8"
> LC_COLLATE="nl_NL.utf8"
> LC_MONETARY="nl_NL.utf8"
> LC_MESSAGES="nl_NL.utf8"
> LC_PAPER="nl_NL.utf8"
> LC_NAME="nl_NL.utf8"
> LC_ADDRESS="nl_NL.utf8"
> LC_TELEPHONE="nl_NL.utf8"
> LC_MEASUREMENT="nl_NL.utf8"
> LC_IDENTIFICATION="nl_NL.utf8"
> LC_ALL=

This one puzzles me a little. I don't think it's the first one in the
locale selector list (which gets selected by default if nothing else is
selected), unless the ordering itself is different in nl_NL?
>
> ~/.dmrc:
>
> [Desktop]
> Language=nl_NL.utf8
> Session=xfce

Did .dmrc existed *before* the test? If so, that explains why
LANG=nl_NL.utf8
>
> Test 2. Log in with changing the language in the language selector to
> english - USA:
>
> locale:
>
> LANG=en_US.utf8
> LANGUAGE=
> LC_CTYPE="en_US.utf8"
> LC_NUMERIC="en_US.utf8"
> LC_TIME="en_US.utf8"
> LC_COLLATE="en_US.utf8"
> LC_MONETARY="en_US.utf8"
> LC_MESSAGES="en_US.utf8"
> LC_PAPER="en_US.utf8"
> LC_NAME="en_US.utf8"
> LC_ADDRESS="en_US.utf8"
> LC_TELEPHONE="en_US.utf8"
> LC_MEASUREMENT="en_US.utf8"
> LC_IDENTIFICATION="en_US.utf8"
> LC_ALL=
>
> ~/.dmrc
>
> [Desktop]
> Language=en_US.utf8
> Session=xfce

That's consistent.
>
> Test 3. Log in without changing the language in the language selector:
>
> locale:
>
> LANG=nl_NL.utf8
> LANGUAGE=
> LC_CTYPE="nl_NL.utf8"
> LC_NUMERIC="nl_NL.utf8"
> LC_TIME="nl_NL.utf8"
> LC_COLLATE="nl_NL.utf8"
> LC_MONETARY="nl_NL.utf8"
> LC_MESSAGES="nl_NL.utf8"
> LC_PAPER="nl_NL.utf8"
> LC_NAME="nl_NL.utf8"
> LC_ADDRESS="nl_NL.utf8"
> LC_TELEPHONE="nl_NL.utf8"
> LC_MEASUREMENT="nl_NL.utf8"
> LC_IDENTIFICATION="nl_NL.utf8"
> LC_ALL=
>
> ~/.dmrc:
>
> [Desktop]
> Language=nl_NL.utf8
> Session=xfce

Here's there a problem. If you don't touch the language selector,
lightdm-gtk-greeter should pick the one from the user .dmrc when the
username is entered (or is selected in the user list). It might be worse
checking the .dmrc from outside X before entering the username, just to
be sure.
>
> Test 4. Log in with changing the language in the language selector to
> english - USA (just to select english for the next test):
>
> locale:
>
> LANG=en_US.utf8
> LANGUAGE=
> LC_CTYPE="en_US.utf8"
> LC_NUMERIC="en_US.utf8"
> LC_TIME="en_US.utf8"
> LC_COLLATE="en_US.utf8"
> LC_MONETARY="en_US.utf8"
> LC_MESSAGES="en_US.utf8"
> LC_PAPER="en_US.utf8"
> LC_NAME="en_US.utf8"
> LC_ADDRESS="en_US.utf8"
> LC_TELEPHONE="en_US.utf8"
> LC_MEASUREMENT="en_US.utf8"
> LC_IDENTIFICATION="en_US.utf8"
> LC_ALL=
>
> ~/.dmrc:
>
> [Desktop]
> Language=en_US.utf8
> Session=xfce

This one is ok.
>
> Test 5:
>
> Restore ~/xsessionrc:

I hope you mean ~/.xsessionrc?
>
> # . /etc/profile
> # . ~/.bash_profile
>
> LANG="en_US.UTF-8"
> export LC_MONETARY="nl_NL.UTF-8"
> export LC_PAPER="nl_NL.UTF-8"
> export LC_MEASUREMENT="nl_NL.UTF-8"
> export LC_TIME="nl_NL.UTF-8"
> export LC_NAME="nl_NL.UTF-8"
> export LC_ADDRESS="nl_NL.UTF-8"
> export LC_TELEPHONE="nl_NL.UTF-8"
> export LC_IDENTIFICATION="nl_NL.UTF-8"
> export LANGUAGE=en
>
> Log in without changing the language in the language selector:

Before sourcing .xsessionrc, I assume the situation is the same as Test
3, so locales should be:

> LANG=nl_NL.utf8
> LANGUAGE=
> LC_CTYPE="nl_NL.utf8"
> LC_NUMERIC="nl_NL.utf8"
> LC_TIME="nl_NL.utf8"
> LC_COLLATE="nl_NL.utf8"
> LC_MONETARY="nl_NL.utf8"
> LC_MESSAGES="nl_NL.utf8"
> LC_PAPER="nl_NL.utf8"
> LC_NAME="nl_NL.utf8"
> LC_ADDRESS="nl_NL.utf8"
> LC_TELEPHONE="nl_NL.utf8"
> LC_MEASUREMENT="nl_NL.utf8"
> LC_IDENTIFICATION="nl_NL.utf8"
> LC_ALL=

Then .xsessionrc is sourced. LANG is set to en_US.UTF-8, but only for
the current shell. LC_ variables are set to nl_NL.UTF-8 (which they
already are) and exported. Then LANGUAGE is set to en and exported to
the environment, so we get:
>
> LANG=nl_NL.utf8
> LANGUAGE=en
> LC_CTYPE="nl_NL.utf8"
> LC_NUMERIC="nl_NL.utf8"
> LC_TIME=nl_NL.UTF-8
> LC_COLLATE="nl_NL.utf8"
> LC_MONETARY=nl_NL.UTF-8
> LC_MESSAGES="nl_NL.utf8"
> LC_PAPER=nl_NL.UTF-8
> LC_NAME=nl_NL.UTF-8
> LC_ADDRESS=nl_NL.UTF-8
> LC_TELEPHONE=nl_NL.UTF-8
> LC_MEASUREMENT=nl_NL.UTF-8
> LC_IDENTIFICATION=nl_NL.UTF-8
> LC_ALL=
>
> ~/.dmrc:
>
> [Desktop]
> Language=nl_NL.utf8
> Session=xfce

Same as Test 4, which is wrong but consistent here.

So I think you should use export LANG= in the above .xsessionrc and it
would correctly set the LANG in the child session.

Now, I have no idea why the saved .dmrc is not correctly loaded for you,
it might help to look at lightdm and lightdm-gtk-greeters logs.

For what it's worth, I think I use more or less the same setup as you:
my main locale is fr_FR.UTF-8 (so I chose that in lightdm locale
selector and it's saved in .dmrc). Then I wan't the text messages in
english, so I only do that in .xsessionrc:

export LC_MESSAGES=en_US.UTF-8

and I get:

LANG=fr_FR.utf8
LANGUAGE=
LC_CTYPE="fr_FR.utf8"
LC_NUMERIC="fr_FR.utf8"
LC_TIME="fr_FR.utf8"
LC_COLLATE="fr_FR.utf8"
LC_MONETARY="fr_FR.utf8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="fr_FR.utf8"
LC_NAME="fr_FR.utf8"
LC_ADDRESS="fr_FR.utf8"
LC_TELEPHONE="fr_FR.utf8"
LC_MEASUREMENT="fr_FR.utf8"
LC_IDENTIFICATION="fr_FR.utf8"
LC_ALL=

Regards,
--
Yves-Alexis Perez
signature.asc

Yves-Alexis Perez

unread,
Jan 14, 2014, 3:40:02 PM1/14/14
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Tue, Jan 14, 2014 at 09:18:17PM +0100, Yves-Alexis Perez wrote:
> Did .dmrc existed *before* the test? If so, that explains why
> LANG=nl_NL.utf8

Also, you need to remove (when logged out) both ~/.dmrc and
/var/cache/lightdm/dmrc/user.dmrc (not too sure why it's cached there, I
guess for cases where homedir is not available before password
validation.

Regards,
- --
Yves-Alexis Perez
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBCgAGBQJS1Z5YAAoJEG3bU/KmdcClZEAH/2xEYj6GqSBh2ARWbFlkdVfZ
Nx3KP3/9Gog/cFrMkIJ/KNzd5IXg3BpnRjwqjgAMJS7ypbq68mB+GtmK1k1p8Xwy
RvxAXyDW8YUg2nczBl7wcoulyo143TuNSDPbnnJyqNtDFX/tV0EdK+Pm4q9kB5KN
+9tdwmNs9kK0p1JAkoLHI0/GmB3Dz1GHRRSxDGVGisQ1/Z2QFFof66YBo6cZbT7h
epK1xzae1XlqUzBigxvso4awPPf/3NngIY+x0rWu8eAhco6OJQJBi3hcLkBvRNwJ
yOKYq6VY/9ltWgocK5Znjm/Szs+u74tqJfVWpBwIFDd4OHXYDJ4gpoNnaTPz+uM=
=O7jd
-----END PGP SIGNATURE-----

Olaf Meeuwissen

unread,
Jan 14, 2014, 11:30:02 PM1/14/14
to
And that user has a ~/.dmrc with a language setting in it. If the user
has no ~/.dmrc, then the first available locale is the default.
Actually, if you enter a user name, move to the password field and then
enter a *different* user's name (one who has no ~/.dmrc), that user will
end up with the previous user's locale preference.

>> The system default would then become
>> the user's locale if a user does not have a ~/.dmrc file. Also, I would
>> expect any tweaks in a user's ~/.xsessionrc to take effect/precedence
>> and not be clobbered by any locale functionality courtesy of lightdm.
>>
>> That is to say, I would expect my LANG setting in ~/.xsessionrc to take
>> precedence over whatever is (or ends up) in ~/.dmrc. If I have nothing
>> in my ~/.xsessionrc, I expect to end up with what is configured in
>> /etc/default/locale.
>
> Well that should be the case, actually.

It is not. I created a new user account on my system and restarted
lightdm. I gave that user the following ~/.xsessionrc

$ cat .xsessionrc
#! /bin/sh

unset LC_ALL
LANG=ja_JP.UTF-8
LC_MESSAGES=en_GB.UTF-8
LANGUAGE=${LC_MESSAGES}

export LANG
export LANGUAGE
export LC_MESSAGES

At the ligthdm login screen, I confirmed that the selected language was
the first one in my system's /etc/locale.gen (aa_DJ.UTF-8) and selected
bo_IN.UTF-8 before logging in.

$ cat .dmrc
[Desktop]
Language=bo_IN.utf8
Session=lightdm-xsession

$ locale
LANG=bo_IN.utf8
LANGUAGE=en_GB.UTF-8
LC_CTYPE="bo_IN.utf8"
LC_NUMERIC="bo_IN.utf8"
LC_TIME="bo_IN.utf8"
LC_COLLATE="bo_IN.utf8"
LC_MONETARY="bo_IN.utf8"
LC_MESSAGES=en_GB.UTF-8
LC_PAPER="bo_IN.utf8"
LC_NAME="bo_IN.utf8"
LC_ADDRESS="bo_IN.utf8"
LC_TELEPHONE="bo_IN.utf8"
LC_MEASUREMENT="bo_IN.utf8"
LC_IDENTIFICATION="bo_IN.utf8"
LC_ALL=

As you can see, the LANG value is *not* as per ~/.xsessionrc which sets
and exports ja_JP.UTF-8. However, the LC_MESSAGES and LANGUAGE
variables *are* as per ~/.xsessionrc.

Subsequent logins use ~/.dmrc to set the user's preceived language
preference when you enter the user name and move to the password field.
After login, the locale is as per above with the *wrong* LANG value.

> The lightdm greeter will select a locale based on .dmrc if it exists,
> but if the user chose another one in the menu, then it'll use that for
> LANG.

My "problem" is that I didn't select any language when I first
encountered the problem. I just entered my user name and password at
the login screen. That's all.
Actually, I don't think I ever bothered selecting a language via that
chooser interface.

> Then, at login, /etc/X11/Xsession is run, which in turns run-parts
> the scripts in /etc/X11/Xsession.d and especially
> 40x11-common_xsessionrc, so whatever you put in .xsessionrc will take
> precedence over previously set variables (and independantly of lightdm)
>
> I repeat, by the time .xsessionrc is parsed, lightdm or the greeter
> doesn't have a chance to do anything to modify the locale anymore.

If that is true, something else must be doing that. Here's what's in my
/etc/X11/Xsession.d/:

20x11-common_process-args
30x11-common_xresources
35x11-common_xhost-local
40x11-common_xsessionrc
50x11-common_determine-startup
55xfce4-session
60xdg-user-dirs-update
70im-config_launch
75dbus_dbus-launch
90consolekit
90gpg-agent
90qt-a11y
90x11-common_ssh-agent
99x11-common_start

I have not changed /etc/X11/Xsession{,.options}

> On Tue, Jan 14, 2014 at 10:32:13AM +0100, Simon Pepping wrote:
>> Package: lightdm-gtk-greeter
>> Version: 1.6.1-5
>> Severity: normal
>> Tags: l10n
>>
>> Dear Maintainer,
>>
>> When I select my language once in the language selector, I want to be
>> logged in with that language on all subsequent log-ins, until I select
>> another language in the language selector. That does not happen. I am
>> always logged with the language of the system-wide locale, unless I
>> select a language in the language selector.

Hmm, system-wide locale being taken into account here. Does not happen
for me, but I'm using

$ cat /etc/default/locale
LANG="C"

which is not in /etc/locale.gen of course.

>> My language setting in ~/.xsessionrc is overwritten. Ideally, the
>> language selector would have a option which leaves the setting in such
>> a script unmodified.
>
> As said above, that's the case. Also, I repeat, .xsessionrc and the
> locale chooser in the lightdm greeters are *completely* unrelated, so
> it's best to separate the test cases. .xsessionrc variables will
> override whatever you set in the locale chooser, and you're then
> responsible for the behavior.

Wishing I was ;-) As I showed above, the LANG variable gets clobbered
by something but LC_MESSAGE and LANGUAGE survive.

>> * What led up to the situation?
>>
>> I select english in the language selector and log in. Language is
>> english. I log out.
>>
>> I make no selection in the language selector and log in. Language is
>> dutch.
>>
>> * What outcome did you expect instead?
>>
>> I expect that subsequent log-ins use the earlier selected language,
>> i.e. english in my case.
>>
>> Note that the locale setting below is the result of logging in with
>> english as the selected language.
>>
>
> In the end, I'm pretty confused by those two bug reports. It seems that
> people are indeed confused by the lightdm/lightdm-gtk-greeter behavior
> wrt. locales, but the reports I get are merely adding confusion, not
> helping to reduce it.
>
> In order to detect issues in LightDM/lightdm-gtk greeter, it'd help to:
>
> - - not set anything locale related in .xsessionrc (since it'll just
> override whatever lightdm set)

Problem is that /etc/X11/Xsession.d/40x11-common_xsessionrc advises you
to do so.

$ head /etc/X11/Xsession.d/40x11-common_xsessionrc
# This file is sourced by Xsession(5), not executed.

#Source user defined xsessionrc (locales and other environment variables)
if [ -r "$USERXSESSIONRC" ]; then
. "$USERXSESSIONRC"
fi

> - - provide the full output of `locales' (and maybe the content of
> $LANGUAGE too)

See above.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962 Help support software freedom
http://www.fsf.org/jf?referrer=1962

Yves-Alexis Perez

unread,
Jan 15, 2014, 2:10:02 AM1/15/14
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Control: clone 735265 -2
Control: retitle -2 don't set locale if no dmrc and no selection is made
Indeed. I guess the correct behaviour would be to not set anything by
default (and reset to that behaviour in case a different username is
selected). This behavior is in lightdm-gtk-greeter by the way.

I'm cloning to a new bug to specifically address this, so we don't get
lost.
Well, again, I'm not responsible for .xsessionrc behavior. The way you
set it looks correct. It might make sense to check the content of
`locales' just before setting them in .xsessionrc (just put the call
on top of .xsessionrc).

But in any case, setting LANG in .xsessionrc doesn't make much sense
imho.
>
> Subsequent logins use ~/.dmrc to set the user's preceived language
> preference when you enter the user name and move to the password field.
> After login, the locale is as per above with the *wrong* LANG value.
>
> > The lightdm greeter will select a locale based on .dmrc if it exists,
> > but if the user chose another one in the menu, then it'll use that for
> > LANG.
>
> My "problem" is that I didn't select any language when I first
> encountered the problem. I just entered my user name and password at
> the login screen. That's all.
> Actually, I don't think I ever bothered selecting a language via that
> chooser interface.

The behavior changed in -4 to actually use what the user might have
selected in the language selector, instead of the previously used
language. Problem is that something is always selected by default.
>
> > Then, at login, /etc/X11/Xsession is run, which in turns run-parts
> > the scripts in /etc/X11/Xsession.d and especially
> > 40x11-common_xsessionrc, so whatever you put in .xsessionrc will take
> > precedence over previously set variables (and independantly of lightdm)
> >
> > I repeat, by the time .xsessionrc is parsed, lightdm or the greeter
> > doesn't have a chance to do anything to modify the locale anymore.
>
> If that is true, something else must be doing that.

Then try to debug using set -x or stuff like that. Sorry for not helping
here, but it's complicated enough just to manage those tricky bugs
inside the greeter.

> Problem is that /etc/X11/Xsession.d/40x11-common_xsessionrc advises you
> to do so.
>
> $ head /etc/X11/Xsession.d/40x11-common_xsessionrc
> # This file is sourced by Xsession(5), not executed.
>
> #Source user defined xsessionrc (locales and other environment variables)
> if [ -r "$USERXSESSIONRC" ]; then
> . "$USERXSESSIONRC"
> fi

No, it just says that you can do stuff there if you want. Nobody forces
you to do that, it's just a nice way to add stuff not already present,
or to correct stuff (like me switching only LC_MESSAGES).

Regards,
- --
Yves-Alexis Perez
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBCgAGBQJS1jKdAAoJEG3bU/KmdcClsroIAIrgBGaak6VpVOcUPL8ZxPoa
j9ee8gYWL0rTVYdeaufOYWDIyPiWRLDhg/POqMa1IEhci05xItLI1T+0mhoWE6rs
zuolMNLdFMx9rjL1MG3rCYqxW8kw+a/Xl9z+wfdMe0Eo520Ncwegndz6O0U1p+sO
BVKNPQX5boFD0oyH9rnrgf4flVWnK/ro3QqN6+qsmxOyTZK3iB3E8tWKKmubvyJK
bZlw2wxSS1sz0gAKK8NdPqFcDre2+R2bos9rHKddXIPMoow9aJDh2X5f9AyQGAaX
DC7RSecbOKwbfEUfAIxCjh1aCVbc/7Gv+UgBIDLmO5Og6rKfiYrDeihlTrfmhIU=
=FjZ9
-----END PGP SIGNATURE-----

Simon Pepping

unread,
Jan 15, 2014, 1:40:02 PM1/15/14
to
On Tue, Jan 14, 2014 at 09:18:17PM +0100, Yves-Alexis Perez wrote:
>
> So I think you should use export LANG= in the above .xsessionrc and it
> would correctly set the LANG in the child session.

Done

> Now, I have no idea why the saved .dmrc is not correctly loaded for you,
> it might help to look at lightdm and lightdm-gtk-greeters logs.

I logged after having removed .dmrc and
/var/cache/lightdm/dmrc/simon.dmrc. It made no difference. I logged
with hide-users true and false. It made no difference. The language
selector is always at Dutch, which is the second entry in the list,
but the system-wide locale. It does not change when I select a
different user.

Herewith a few more data, reporting the locale before and after
.xsessionrc, and the lightdm logs.

Action: Select english in the language selector, log in.

1) Report of locale settings in .xsessionrc:

before .xsessionrc
LANG=nl_NL.UTF-8
LANGUAGE=
LC_CTYPE="nl_NL.UTF-8"
LC_NUMERIC="nl_NL.UTF-8"
LC_TIME="nl_NL.UTF-8"
LC_COLLATE="nl_NL.UTF-8"
LC_MONETARY="nl_NL.UTF-8"
LC_MESSAGES="nl_NL.UTF-8"
LC_PAPER="nl_NL.UTF-8"
LC_NAME="nl_NL.UTF-8"
LC_ADDRESS="nl_NL.UTF-8"
LC_TELEPHONE="nl_NL.UTF-8"
LC_MEASUREMENT="nl_NL.UTF-8"
LC_IDENTIFICATION="nl_NL.UTF-8"
LC_ALL=

after
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME=nl_NL.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=nl_NL.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=nl_NL.UTF-8
LC_NAME=nl_NL.UTF-8
LC_ADDRESS=nl_NL.UTF-8
LC_TELEPHONE=nl_NL.UTF-8
LC_MEASUREMENT=nl_NL.UTF-8
LC_IDENTIFICATION=nl_NL.UTF-8
LC_ALL=

export GDM_LANG='en_US.utf8'
export LANG='en_US.UTF-8'
export LANGUAGE='en'

2) locale settings in XFCE, after login:

LANG=en_US.utf8
LANGUAGE=en
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME=nl_NL.UTF-8
LC_COLLATE="en_US.utf8"
LC_MONETARY=nl_NL.UTF-8
LC_MESSAGES="en_US.utf8"
LC_PAPER=nl_NL.UTF-8
LC_NAME=nl_NL.UTF-8
LC_ADDRESS=nl_NL.UTF-8
LC_TELEPHONE=nl_NL.UTF-8
LC_MEASUREMENT=nl_NL.UTF-8
LC_IDENTIFICATION=nl_NL.UTF-8
LC_ALL=

declare -x LANG="en_US.utf8"
declare -x LANGUAGE="en"

Note that GDM_LANG has disappeard, and that the output format of the
export command has changed, possibly due to different shells: dash for
.xsessionrc and bash in the X session.

3) lightdm log file

Note that this is not the first login

[+244.74s] DEBUG: Seat: Active display server stopped, starting greeter
[+244.74s] DEBUG: Seat: Creating greeter session
[+244.74s] DEBUG: Seat: Setting XDG_SEAT=seat0
[+244.74s] DEBUG: Seat: Creating display server of type x
[+244.74s] DEBUG: Seat: Starting local X display
[+244.74s] DEBUG: Using VT 7
[+244.74s] DEBUG: DisplayServer x-0: Logging to /var/log/lightdm/x-0.log
[+244.74s] DEBUG: DisplayServer x-0: Writing X server authority to /var/run/lightdm/root/:0
[+244.74s] DEBUG: DisplayServer x-0: Launching X Server
[+244.74s] DEBUG: Launching process 4302: /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
[+244.74s] DEBUG: DisplayServer x-0: Waiting for ready signal from X server :0
[+244.74s] DEBUG: Releasing VT 7
[+244.86s] DEBUG: Got signal 10 from process 4302
[+244.86s] DEBUG: DisplayServer x-0: Got signal from X server :0
[+244.86s] DEBUG: DisplayServer x-0: Connecting to XServer :0
[+244.86s] DEBUG: Seat: Display server ready, starting session authentication
[+244.86s] DEBUG: Session: Setting XDG_VTNR=7
[+244.86s] DEBUG: Session pid=4307: Started with service 'lightdm-greeter', username 'lightdm'
[+244.88s] DEBUG: Session pid=4307: Authentication complete with return value 0: Success
[+244.88s] DEBUG: Seat: Session authenticated, running command
[+244.88s] DEBUG: Session pid=4307: Setting XDG_VTNR=7
[+244.88s] DEBUG: Session pid=4307: Running command /usr/sbin/lightdm-gtk-greeter
[+244.88s] DEBUG: Session pid=4307: Logging to /var/log/lightdm/x-0-greeter.log
[+244.90s] DEBUG: Activating VT 7
[+244.94s] DEBUG: Session pid=4307: Greeter connected version=1.8.5
[+245.31s] DEBUG: Session pid=4307: Greeter start authentication for simon
[+245.31s] DEBUG: Seat: Setting XDG_SEAT=seat0
[+245.31s] DEBUG: Session: Setting XDG_VTNR=7
[+245.31s] DEBUG: Session pid=4334: Started with service 'lightdm', username 'simon'
[+245.32s] DEBUG: Session pid=4334: Got 1 message(s) from PAM
[+245.32s] DEBUG: Session pid=4307: Prompt greeter with 1 message(s)
[+267.43s] DEBUG: Session pid=4307: Continue authentication
[+267.46s] DEBUG: Session pid=4334: Authentication complete with return value 0: Success
[+267.46s] DEBUG: Session pid=4307: Authenticate result for user simon: Success
[+267.47s] DEBUG: Session pid=4307: User simon authorized
[+267.47s] DEBUG: Session pid=4307: Greeter sets language en_US.utf8
[+267.48s] DEBUG: Writing /home/simon/.dmrc
[+267.56s] DEBUG: Session pid=4307: Greeter requests session xfce
[+267.57s] DEBUG: Writing /home/simon/.dmrc
[+267.63s] DEBUG: Seat: Stopping greeter; display server will be re-used for user session
[+267.63s] DEBUG: Session pid=4307: Sending SIGTERM
[+267.65s] DEBUG: Session pid=4307: Greeter closed communication channel
[+267.65s] DEBUG: Session pid=4307: Exited with return value 0
[+267.65s] DEBUG: Seat: Session stopped
[+267.65s] DEBUG: Seat: Greeter stopped, running session
[+267.65s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session1
[+267.65s] DEBUG: Session pid=4334: Setting XDG_VTNR=7
[+267.65s] DEBUG: Session pid=4334: Running command /etc/X11/Xsession startxfce4
[+267.65s] DEBUG: Session pid=4334: Logging to .xsession-errors
[+267.67s] DEBUG: Activating VT 7

lightdm-gtk-greeter log:

(lightdm-gtk-greeter:4316): GLib-CRITICAL **: g_shell_parse_argv: assertion `command_line != NULL' failed

** (lightdm-gtk-greeter:4316): WARNING **: Failed to open sessions directory: Fout bij openen van map ‘/usr/share/lightdm/sessions’: Bestand of map bestaat niet

** (lightdm-gtk-greeter:4316): WARNING **: Failed to open sessions directory: Fout bij openen van map ‘/usr/share/lightdm/remote-sessions’: Bestand of map bestaat niet

** (lightdm-gtk-greeter:4316): WARNING **: Failed to load user image: Openen van bestand ‘/home/simon/.face’ mislukt: Bestand of map bestaat niet

End of reports

Note that the greeter writes to .dmrc but does not report reading from
it.

I have the strong impression that the greeter does not set LANG but
writes it to .dmrc, from which it is read and set in the session at a
later stage, after .xsessionrc was run.

Note also that my session in .dmrc is reported as 'xfce', while I see
in reports by other users 'lightdm-xsession'.

Olaf Meeuwissen

unread,
Jan 15, 2014, 7:40:01 PM1/15/14
to
Yves-Alexis Perez writes:

>> [snip]
>> And that user has a ~/.dmrc with a language setting in it. If the user
>> has no ~/.dmrc, then the first available locale is the default.
>> Actually, if you enter a user name, move to the password field and then
>> enter a *different* user's name (one who has no ~/.dmrc), that user will
>> end up with the previous user's locale preference.
>
> Indeed. I guess the correct behaviour would be to not set anything by
> default (and reset to that behaviour in case a different username is
> selected). This behavior is in lightdm-gtk-greeter by the way.
>
> I'm cloning to a new bug to specifically address this, so we don't get
> lost.

Thanks.

>> [snip]
>> As you can see, the LANG value is *not* as per ~/.xsessionrc which sets
>> and exports ja_JP.UTF-8. However, the LC_MESSAGES and LANGUAGE
>> variables *are* as per ~/.xsessionrc.
>
> Well, again, I'm not responsible for .xsessionrc behavior. The way you
> set it looks correct. It might make sense to check the content of
> `locales' just before setting them in .xsessionrc (just put the call
> on top of .xsessionrc).

Did just that. All locale variables, including LANG, are as per tweaks
in ~/.xsessionrc right up to the `exec $STARTUP` in the last Xsession.d
snippet. The locale output in an Xfce terminal or XTerm shows the LANG
value that is in ~/.dmrc. That is, not whatever LANG value was set in
~/.xsessionrc.

I also tried turning off all autostarted applications (in the Session
and Startup configuration utility) but LANG *still* gets clobbered. At
this point, no applications started automatically, Xfsettingsd is still
started despite not being configured to do so. My hunch is that either
that or one of xfwm4 and xfdesktop export LANG based on what is set in
~/.dmrc (or /var/cache/lightdm/dmrc/$USER.dmrc).

> But in any case, setting LANG in .xsessionrc doesn't make much sense
> imho.

Care to explain why? For me the correct LANG value is essential to get
my input method editor to work correctly (or so it seems).
# Of course, setting it in ~/.dmrc works for me but I'd like to know why
# I should set it there too.

>> > [snip]
>> > I repeat, by the time .xsessionrc is parsed, lightdm or the greeter
>> > doesn't have a chance to do anything to modify the locale anymore.
>>
>> If that is true, something else must be doing that.
>
> Then try to debug using set -x or stuff like that. Sorry for not helping
> here, but it's complicated enough just to manage those tricky bugs
> inside the greeter.

See above. It looks like the LANG value is clobbered later, somewhere
in $STARTUP, which in my case is

/usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch x-session-manager

>> Problem is that /etc/X11/Xsession.d/40x11-common_xsessionrc advises you
>> to do so.
>>
>> $ head /etc/X11/Xsession.d/40x11-common_xsessionrc
>> # This file is sourced by Xsession(5), not executed.
>>
>> #Source user defined xsessionrc (locales and other environment variables)
>> if [ -r "$USERXSESSIONRC" ]; then
>> . "$USERXSESSIONRC"
>> fi
>
> No, it just says that you can do stuff there if you want. Nobody forces
> you to do that, it's just a nice way to add stuff not already present,
> or to correct stuff (like me switching only LC_MESSAGES).

I know nobody forces me to do so, but I parse the above as "if you want
to modify your locale settings or other environment variables, your
~/.xsessionrc is the place to do so". Hence, I did and it didn't work
as expected. Maybe there should be some documentation that (at least)
LANG should be set elsewhere because $STARTUP may override it?

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962 Help support software freedom
http://www.fsf.org/jf?referrer=1962


Yves-Alexis Perez

unread,
Jan 16, 2014, 4:10:02 AM1/16/14
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Wed, Jan 15, 2014 at 07:29:02PM +0100, Simon Pepping wrote:
> On Tue, Jan 14, 2014 at 09:18:17PM +0100, Yves-Alexis Perez wrote:
> >
> > So I think you should use export LANG= in the above .xsessionrc and it
> > would correctly set the LANG in the child session.
>
> Done
>
> > Now, I have no idea why the saved .dmrc is not correctly loaded for you,
> > it might help to look at lightdm and lightdm-gtk-greeters logs.
>
> I logged after having removed .dmrc and
> /var/cache/lightdm/dmrc/simon.dmrc. It made no difference. I logged
> with hide-users true and false. It made no difference. The language
> selector is always at Dutch, which is the second entry in the list,
> but the system-wide locale. It does not change when I select a
> different user.

Ok, so actually it /does/ use the system locale by default, which is a
rather good idea.
>
> Herewith a few more data, reporting the locale before and after
> .xsessionrc, and the lightdm logs.
>
> Action: Select english in the language selector, log in.
>
> 1) Report of locale settings in .xsessionrc:
>
> before .xsessionrc
> LANG=nl_NL.UTF-8
> LANGUAGE=
> LC_CTYPE="nl_NL.UTF-8"
> LC_NUMERIC="nl_NL.UTF-8"
> LC_TIME="nl_NL.UTF-8"
> LC_COLLATE="nl_NL.UTF-8"
> LC_MONETARY="nl_NL.UTF-8"
> LC_MESSAGES="nl_NL.UTF-8"
> LC_PAPER="nl_NL.UTF-8"
> LC_NAME="nl_NL.UTF-8"
> LC_ADDRESS="nl_NL.UTF-8"
> LC_TELEPHONE="nl_NL.UTF-8"
> LC_MEASUREMENT="nl_NL.UTF-8"
> LC_IDENTIFICATION="nl_NL.UTF-8"
> LC_ALL=

So the language selection from the greeter doesn't actually work here?
>
> after
> LANG=en_US.UTF-8
> LANGUAGE=en
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC="en_US.UTF-8"
> LC_TIME=nl_NL.UTF-8
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY=nl_NL.UTF-8
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER=nl_NL.UTF-8
> LC_NAME=nl_NL.UTF-8
> LC_ADDRESS=nl_NL.UTF-8
> LC_TELEPHONE=nl_NL.UTF-8
> LC_MEASUREMENT=nl_NL.UTF-8
> LC_IDENTIFICATION=nl_NL.UTF-8
> LC_ALL=
>
> export GDM_LANG='en_US.utf8'
> export LANG='en_US.UTF-8'
> export LANGUAGE='en'

Honestly, I don't want to debug anything past .xsessionrc, this is
outside of lightdm scope and it's already complicated enough.
.dmrc is handled by lightdm, not the greeter. The greeter is only
involved in the language selector and username entry.
>
> I have the strong impression that the greeter does not set LANG but
> writes it to .dmrc, from which it is read and set in the session at a
> later stage, after .xsessionrc was run.

Again, it's lightdm itself that sets the LANG environment variable.
Either using the one from the user .dmrc (username obtained from the greeter when an
login is entered) or the one from the locale selected in the greeter.

And .dmrc is also read/written by lightdm. Only the information itself
is passed from the daemon to the greeter and vice versa.
>
> Note also that my session in .dmrc is reported as 'xfce', while I see
> in reports by other users 'lightdm-xsession'.

The lightdm-xsession is just a default session file which hooks lightdm
to the Debian configured defaults (it just passes “default” to
/etc/X11/Xsession, which in turns use x-session-manager /
x-window-manager alternatives).

Regards,
- --
Yves-Alexis Perez
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBCgAGBQJS15/dAAoJEG3bU/KmdcCluvIH/0mlZzX4iPdjlqC1ctIczzot
Vgr8JkLz/W73Oqm5fh639qzvToYVzurkwNZnyDCwYlJfP99hOmDyR4Dl5F+M2v9w
nwbegWzM6say756humohu18QafTGc1szzfkrBwavI7XF5i5EUcGd+QiW1AIHblJ5
nnUSDw5hCRJs+cc6RUyt4+ZMXqTKX1Jfn+ENYFekPJIFO70mM1Uas8QAFGaw9euR
v1GybFgHug3TcssZKQN32EP7J/iOk0pANO7EcXdocEIO2PS8vpahGTVv6FkK5QN1
4826oVll1+vW0f5BVFYjtCO5wKUSTZRy85zEgTMc0GCgZvzBiPpQBxwWYIEiDno=
=I9A7
-----END PGP SIGNATURE-----

Yves-Alexis Perez

unread,
Jan 16, 2014, 4:20:02 AM1/16/14
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Thu, Jan 16, 2014 at 09:28:32AM +0900, Olaf Meeuwissen wrote:
> Did just that. All locale variables, including LANG, are as per tweaks
> in ~/.xsessionrc right up to the `exec $STARTUP` in the last Xsession.d
> snippet. The locale output in an Xfce terminal or XTerm shows the LANG
> value that is in ~/.dmrc. That is, not whatever LANG value was set in
> ~/.xsessionrc.

Ok, so in any case, lightdm is not involved here anymore.
>
> I also tried turning off all autostarted applications (in the Session
> and Startup configuration utility) but LANG *still* gets clobbered. At
> this point, no applications started automatically, Xfsettingsd is still
> started despite not being configured to do so. My hunch is that either
> that or one of xfwm4 and xfdesktop export LANG based on what is set in
> ~/.dmrc (or /var/cache/lightdm/dmrc/$USER.dmrc).

No, that's completely unrelated. .dmrc is really only related to the DM.
>
> > But in any case, setting LANG in .xsessionrc doesn't make much sense
> > imho.
>
> Care to explain why? For me the correct LANG value is essential to get
> my input method editor to work correctly (or so it seems).
> # Of course, setting it in ~/.dmrc works for me but I'd like to know why
> # I should set it there too.

The way I see it (as I already explained), you select the wanted locale
(LANG) in the greeter language selector (and it gets saved to .dmrc for
later). Then, if you need to “correct” (for LC_MESSAGES for example) you
can do it un .xsessionrc.

Now, nobody forces you to do that way, you can do whatever you want in
.xsessionrc and completely ignore the greeter.

> See above. It looks like the LANG value is clobbered later, somewhere
> in $STARTUP, which in my case is
>
> /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch x-session-manager

Then you know where to start looking. But as I said to Simon, that's
pretty much outside my perimeter (well unless it happens in
xfce4-session, but that's unrelated to lightdm anyway, and I need to
pick my Xfce hat).

With my Xfce hat on, that reminds me of something worth checking. I
think xfce4-session tries to respect GDM_LANG and overwrites LANG with
it. LightDM doesn't set GDM_LANG (that's a gdm thing) but I think Simon
did set it manually at some point, which might then have this side
effect. Maybe check that's not your case?

> I know nobody forces me to do so, but I parse the above as "if you want
> to modify your locale settings or other environment variables, your
> ~/.xsessionrc is the place to do so". Hence, I did and it didn't work
> as expected. Maybe there should be some documentation that (at least)
> LANG should be set elsewhere because $STARTUP may override it?

Well, anything can modify LANG its the child processes anyway, there's
nothing the parents can do about that.

In any case, I'm again just confused on all those bugs, but my feeling
is just that there's no bug in lightdm/lightdm-gtk-greeter here, but
later in the startup process, so those bugs should either be reassigned
or just closed, in order top stop confusion.

Regards,
- --
Yves-Alexis Perez
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBCgAGBQJS16L/AAoJEG3bU/KmdcCl6CsIAJ6+8HbEPMADO12SDPqtE4UB
ZUSrb4ZuG1Bu/K7iu55O8n5soqo9f7/nx2WtRuI4MFGvay8MBwcq4qa2MtzTtesn
UpHoX3t3/G3fDXF4qxyAdqN13yF/3txhRiinLdzsgIKbq9Tr3VTAtS/r4gXXItzg
BuZd7h6yiPO4hehByKFno6MxWdmqwtSArfORZQDZP+G1BHUVuB2JJCF0TV1IQQD2
ca5T66m+2xtkqhUPibn/dSqVg7TMWVrnYU2MjKbG8KsHYHwmoB9g8ZYLL5eUeFfe
fQruoiU8JYvL07SivpIQ1a0bUKNjslRADXc+3DhPdJpyYVvIIhuJeSkIGoCPue8=
=kNYV
-----END PGP SIGNATURE-----

Olaf Meeuwissen

unread,
Jan 16, 2014, 11:10:03 PM1/16/14
to
Yves-Alexis Perez writes:

>> > But in any case, setting LANG in .xsessionrc doesn't make much sense
>> > imho.
>>
>> Care to explain why? For me the correct LANG value is essential to get
>> my input method editor to work correctly (or so it seems).
>> # Of course, setting it in ~/.dmrc works for me but I'd like to know why
>> # I should set it there too.
>
> The way I see it (as I already explained), you select the wanted locale
> (LANG) in the greeter language selector (and it gets saved to .dmrc for
> later). Then, if you need to “correct” (for LC_MESSAGES for example) you
> can do it un .xsessionrc.

The greeter language selector does not seem to set LANG. At the very
beginning of the /etc/X11/Xsession script LANG=C. I change it in my
~/.xsessionrc to ja_JP.UTF-8. When Xsession finally exec's $STARTUP
the LANG value is still jp_JP.UTF-8. That notwithstanding, the LANG
value in an Xfce Terminal and XTerm is the value that corresponds with
the one selected/defaulted by the greeter's language selector.

> Now, nobody forces you to do that way, you can do whatever you want in
> .xsessionrc and completely ignore the greeter.
>
>> See above. It looks like the LANG value is clobbered later, somewhere
>> in $STARTUP, which in my case is
>>
>> /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch x-session-manager
>
> Then you know where to start looking. But as I said to Simon, that's
> pretty much outside my perimeter (well unless it happens in
> xfce4-session, but that's unrelated to lightdm anyway, and I need to
> pick my Xfce hat).
>
> With my Xfce hat on, that reminds me of something worth checking. I
> think xfce4-session tries to respect GDM_LANG and overwrites LANG with
> it. LightDM doesn't set GDM_LANG (that's a gdm thing) but I think Simon
> did set it manually at some point, which might then have this side
> effect. Maybe check that's not your case?

Did that. GDM_LANG is set to whatever the greeter's language selector
has selected/defaulted and it has this throughout the Xsession script,
right from the start all the way to `exec $STARTUP`.

>> I know nobody forces me to do so, but I parse the above as "if you want
>> to modify your locale settings or other environment variables, your
>> ~/.xsessionrc is the place to do so". Hence, I did and it didn't work
>> as expected. Maybe there should be some documentation that (at least)
>> LANG should be set elsewhere because $STARTUP may override it?
>
> Well, anything can modify LANG its the child processes anyway, there's
> nothing the parents can do about that.

Sure, just like any child process can wipe my $HOME directory. But that
is not the point. The point is whether child processes should modify my
LANG variable (just because some GDM_LANG value exists with a different
value). And in this particular case it affects my whole desktop session.

FWIW, lightdm seems to be exporting GDM_LANG, see src/seat.c in the
configure_session() function. I see it does the same for GDMSESSION.
Are these variables GTK+ or GNOME specific? If the latter, then maybe
lightdm shouldn't be exporting these, but what do I know?
Just an idea, but why not simply export LANG instead (or as well)?

I'm off nuking GDM_LANG (and maybe GDMSESSION) in my ~/.xsessionrc and
see what breaks ;-)

> In any case, I'm again just confused on all those bugs, but my feeling
> is just that there's no bug in lightdm/lightdm-gtk-greeter here, but
> later in the startup process, so those bugs should either be reassigned
> or just closed, in order top stop confusion.

Hope this helps unconfusing a bit,
--
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962 Help support software freedom
http://www.fsf.org/jf?referrer=1962


Yves-Alexis Perez

unread,
Jan 17, 2014, 4:00:02 AM1/17/14
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Fri, Jan 17, 2014 at 01:01:11PM +0900, Olaf Meeuwissen wrote:
> Yves-Alexis Perez writes:
>
> >> > But in any case, setting LANG in .xsessionrc doesn't make much sense
> >> > imho.
> >>
> >> Care to explain why? For me the correct LANG value is essential to get
> >> my input method editor to work correctly (or so it seems).
> >> # Of course, setting it in ~/.dmrc works for me but I'd like to know why
> >> # I should set it there too.
> >
> > The way I see it (as I already explained), you select the wanted locale
> > (LANG) in the greeter language selector (and it gets saved to .dmrc for
> > later). Then, if you need to “correct” (for LC_MESSAGES for example) you
> > can do it un .xsessionrc.
>
> The greeter language selector does not seem to set LANG.

The greeter doesn't set anything, it gets the menu selection and gives
it to lightdm.

> At the very
> beginning of the /etc/X11/Xsession script LANG=C.

Well, this one is a problem, it's should not be the case (and it's not
the case for me on any of my box).

> FWIW, lightdm seems to be exporting GDM_LANG, see src/seat.c in the
> configure_session() function.

Indeed, I missed that.

> I see it does the same for GDMSESSION.
> Are these variables GTK+ or GNOME specific?

My guess is that they get used by GNOME applications.

> If the latter, then maybe
> lightdm shouldn't be exporting these, but what do I know?
> Just an idea, but why not simply export LANG instead (or as well)?

If you look really really hard, you'll see that LANG is set on the
previous line.
>
> I'm off nuking GDM_LANG (and maybe GDMSESSION) in my ~/.xsessionrc and
> see what breaks ;-)

Since lightdm set GDM_LANG to the exact same value as LANG, I fail to
see why it's not set to the correct value at the beginning of
/etc/X11/Xsession, but at least that gives you something to look at.

Regards,
- --
Yves-Alexis Perez
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBCgAGBQJS2O/2AAoJEG3bU/KmdcCl5WoH/25KFl7axxZ88fQMMBbsvVoT
OcOdUTCSjiL3nd7r16X6mMWRhDymYgFyEjdJjOwaOU0vwaoiaqrGVGWDtMBe/qjK
o9ZyF7XG6dLR/7KvZYusxT3/+q0YeTXOMwqVUJ34Y9NmJuJYVi1kMPwQMU3bwpBM
1IyFJ5BNMhmyP/9Sl7hSKf2yLcKxqHIyJh7drrJFNjLd+rbHAGygyFQs2c8VzV2m
oBQfk2ncoB5IFZEV5jrJQOlAeF8nAzsekQ+rs8VwOfU0vWW/xXyXOMmDrZsMXMlm
kgaSBL9WUFUxOGG0v1OwuePoNNbOCmBKPE7o6zeHDiDrOtlC9b/BWJuZjf1d3LY=
=n5ub
-----END PGP SIGNATURE-----

Olaf Meeuwissen

unread,
Jan 19, 2014, 11:10:03 PM1/19/14
to
Yves-Alexis Perez writes:

> On Fri, Jan 17, 2014 at 01:01:11PM +0900, Olaf Meeuwissen wrote:
>> Yves-Alexis Perez writes:
>>
>> >> > But in any case, setting LANG in .xsessionrc doesn't make much sense
>> >> > imho.
>> >>
>> >> Care to explain why? For me the correct LANG value is essential to get
>> >> my input method editor to work correctly (or so it seems).
>> >> # Of course, setting it in ~/.dmrc works for me but I'd like to know why
>> >> # I should set it there too.
>> >
>> > The way I see it (as I already explained), you select the wanted locale
>> > (LANG) in the greeter language selector (and it gets saved to .dmrc for
>> > later). Then, if you need to “correct” (for LC_MESSAGES for example) you
>> > can do it un .xsessionrc.
>>
>> The greeter language selector does not seem to set LANG.
>
> The greeter doesn't set anything, it gets the menu selection and gives
> it to lightdm.
>
>> At the very
>> beginning of the /etc/X11/Xsession script LANG=C.
>
> Well, this one is a problem, it's should not be the case (and it's not
> the case for me on any of my box).

C is the default locale on my system.

>> FWIW, lightdm seems to be exporting GDM_LANG, see src/seat.c in the
>> configure_session() function.
>
> Indeed, I missed that.
>
>> I see it does the same for GDMSESSION.
>> Are these variables GTK+ or GNOME specific?
>
> My guess is that they get used by GNOME applications.
>
>> If the latter, then maybe
>> lightdm shouldn't be exporting these, but what do I know?
>> Just an idea, but why not simply export LANG instead (or as well)?
>
> If you look really really hard, you'll see that LANG is set on the
> previous line.

And I obviously missed that ;-)

>> I'm off nuking GDM_LANG (and maybe GDMSESSION) in my ~/.xsessionrc and
>> see what breaks ;-)
>
> Since lightdm set GDM_LANG to the exact same value as LANG, I fail to
> see why it's not set to the correct value at the beginning of
> /etc/X11/Xsession, but at least that gives you something to look at.

Okay, I've been looking at the source code a bit. Turns out that
session_set_env() does not set any environment variables directly. It
adds them to an internal list (session->priv->env). This list is
written to the session in `session_real_run()`. I didn't find any calls
to `session_unset_env()` for either LANG and GDM_LANG so would expect
both to be set in the session.

However, the greeter and user session inherit the system default locale
courtesy of PAM as per comment in src/session-child.c. This probably
explains why I see LANG=C at the start of my Xsession.

Anyway, I now nuke GDM_LANG in ~/.xsessionrc and have not seen any
breakage yet. The `locale` output is as I expect it and my input method
editor works as it used to. I no longer have a ~/.dmrc (and it is not
recreated when you don't save your session). I can pick any language I
please from the chooser without this having *any* effect on my session.
That is, the chooser does not interfere with my customizations which is
what I want.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962 Help support software freedom
http://www.fsf.org/jf?referrer=1962


Yves-Alexis Perez

unread,
Jan 20, 2014, 1:50:01 AM1/20/14
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Mon, Jan 20, 2014 at 01:02:26PM +0900, Olaf Meeuwissen wrote:
> >> At the very
> >> beginning of the /etc/X11/Xsession script LANG=C.
> >
> > Well, this one is a problem, it's should not be the case (and it's not
> > the case for me on any of my box).
>
> C is the default locale on my system.

Ok, I don't have a default locale here (so it means it defaults to
POSIX).

> Okay, I've been looking at the source code a bit. Turns out that
> session_set_env() does not set any environment variables directly. It
> adds them to an internal list (session->priv->env). This list is
> written to the session in `session_real_run()`. I didn't find any calls
> to `session_unset_env()` for either LANG and GDM_LANG so would expect
> both to be set in the session.
>
> However, the greeter and user session inherit the system default locale
> courtesy of PAM as per comment in src/session-child.c. This probably
> explains why I see LANG=C at the start of my Xsession.

That might make sense, although I don't think it's the correct behavior
in case an user actually choose a language in the selector.

> Anyway, I now nuke GDM_LANG in ~/.xsessionrc and have not seen any
> breakage yet. The `locale` output is as I expect it and my input method
> editor works as it used to. I no longer have a ~/.dmrc (and it is not
> recreated when you don't save your session). I can pick any language I
> please from the chooser without this having *any* effect on my session.
> That is, the chooser does not interfere with my customizations which is
> what I want.
>
.dmrc has nothing to do with saving the session. And it's created (or at
least should be) *before* the session is actually started.

Regards.
- --
Yves-Alexis Perez
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBCgAGBQJS3MYFAAoJEG3bU/KmdcCl/vEH/3s8idL1HPHVw+23abnGMte7
3ZefLPY4d+Mzyrd55eKmwUiU2UTO36P7uf3BhqrtmXPePdz7+jLkWHMSElly4NR4
/ucfGYD6VQyEZ4nvsJRV3a182wlhSXqDq2GXfYEFJ6DOZnUkB/sa7VfIJm9lBDH1
e4rWHpDRCbEVepvEZgQbDiJDKEXXCT/g4CzTSKsWGrMa1LRZLHUVOcI0ErN2DPGY
Iz1ep4Pq2MbAXRbN7dqkrSibIEPWhoYSEACo2TQOOgFUeG4a4sMh4y3HBlS+LooV
9i3+pfrb3pYcr/sgkXBodepQ3EkvPPNww8Ksu3y0ydQ46inCXLdK7NWOGNDyKz4=
=ap2m
-----END PGP SIGNATURE-----

Olaf Meeuwissen

unread,
Jan 20, 2014, 6:50:01 PM1/20/14
to
Yves-Alexis Perez writes:

> On Mon, Jan 20, 2014 at 01:02:26PM +0900, Olaf Meeuwissen wrote:
>> >> At the very
>> >> beginning of the /etc/X11/Xsession script LANG=C.
>> >
>> > Well, this one is a problem, it's should not be the case (and it's not
>> > the case for me on any of my box).
>>
>> C is the default locale on my system.
>
> Ok, I don't have a default locale here (so it means it defaults to
> POSIX).

AFAIK that's the same as C and the Open Group seems to agree[1] ;-)

[1] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html

But of course, LANG= and LANG=C are not exactly the same thing.

>> Okay, I've been looking at the source code a bit. Turns out that
>> session_set_env() does not set any environment variables directly. It
>> adds them to an internal list (session->priv->env). This list is
>> written to the session in `session_real_run()`. I didn't find any calls
>> to `session_unset_env()` for either LANG and GDM_LANG so would expect
>> both to be set in the session.
>>
>> However, the greeter and user session inherit the system default locale
>> courtesy of PAM as per comment in src/session-child.c. This probably
>> explains why I see LANG=C at the start of my Xsession.
>
> That might make sense, although I don't think it's the correct behavior
> in case an user actually choose a language in the selector.

You've probably seen the code and noticed that it is not just LANG that
is inherited. A number of LC_* variables may get set as well. Seeing
the that chooser does not account for those (quite understandably), it
seems to be the right thing to do to me considering the purpose of
/etc/default/locale. What you *might* want to do is set LANG to the
value of GDM_LANG if and only if the user actually chose a language in
the selector. Seeing that not selecting a language (or unselecting
whatever is selected, possibly by default) is not supported at present,
I would not do so at this point though.

>> Anyway, I now nuke GDM_LANG in ~/.xsessionrc and have not seen any
>> breakage yet. The `locale` output is as I expect it and my input method
>> editor works as it used to. I no longer have a ~/.dmrc (and it is not
>> recreated when you don't save your session). I can pick any language I
>> please from the chooser without this having *any* effect on my session.
>> That is, the chooser does not interfere with my customizations which is
>> what I want.
>>
> .dmrc has nothing to do with saving the session. And it's created (or at
> least should be) *before* the session is actually started.

Sorry, my fault. I had a line in my Xsession setup that removed the
file. I'd forgotten about that. The ~/.dmrc file is created.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962 Help support software freedom
http://www.fsf.org/jf?referrer=1962


Vincent Lefevre

unread,
Jul 24, 2018, 11:00:03 AM7/24/18
to
On 2014-01-17 09:55:22 +0100, Yves-Alexis Perez wrote:
> The greeter doesn't set anything, it gets the menu selection and gives
> it to lightdm.

A problem is that the greeter forces the first menu entry to be
selected by default instead of having a "nothing selected" state.

I reported the following bug against the greeter:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855763

which may actually be the same bug as 735401 (I'm a bit confused
by this bug, but it seems that it because it is the result of a
clone, and the text of the clone message doesn't appear on the
web page); I'm adding this bug to the Cc list.

--
Vincent Lefèvre <vin...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
0 new messages