[Pkg-xfce-devel] Bug#735265: Bug#735251: lightdm: user locale tweaks are clobbered by non-default locale

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Thu Jan 16 00:28:32 UTC 2014


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



More information about the Pkg-xfce-devel mailing list