Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 538458

Summary: net-misc/x2goclient fails to set locale
Product: Gentoo Linux Reporter: Sven <sven.koehler>
Component: Current packagesAssignee: Bernard Cafarelli <voyageur>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Sven 2015-02-01 17:09:47 UTC
When connecting with x2goclient to a Gentoo PC running x2goserver, then the LANG variable and the various LC_* variables are all empty.

/etc/env.d/02locale exists, contains LANG=de_DE.utf-8, and when not using the Gentoo PC remotely, everything is fine.

I suspect that somehow /etc/profile is never sourced. Not sure whether ~/.bashrc and/or ~/.bash_profile are sourced.

Obviously, this causes all kinds of problems (strange characters in terminal, etc.).

Reproducible: Always

Steps to Reproduce:
In x2goclient, configure a session that launches a single application. As the command chose "Terminal" from the drop down. In my case, this will launch mate-terminal.
Actual Results:  
mate-terminal doesn't understand UTF-8 (ls -la shows broken folder names)

Expected Results:  
mate-terminal does understand UTF-8 (ls -la shows proper folder names)
Comment 1 Sven 2015-02-01 17:10:11 UTC
This sounds very similar:
https://bbs.archlinux.org/viewtopic.php?id=151160
Comment 2 Sven 2015-02-02 12:02:50 UTC
It's not the x2goclient who fails to set it. IMHO, the server needs to set it. More specifically, I think that x2goruncommand is to blame.
Comment 3 Kai W├╝stermann 2015-04-02 13:15:31 UTC
There is a small workaround I found here:
https://bbs.archlinux.de/viewtopic.php?id=22069

On the server you create a script x2go-german.sh

#!/bin/bash
export LANG=de_DE.UTF-8
exec however_you_start_your_desktop

In x2go-client you choose "Custom Desktop" and uses x2go-german.sh as command.
Comment 4 Kai W├╝stermann 2015-08-20 08:14:07 UTC
It seems x2go has no support to set locale.

I have learned:
If you login in to the Server via ssh, pam sets the locale. This works fine if you log in with ssh user@server.

x2go login via ssh. pyhoca or x2goclient should know the locale but don't give it to the programs they start.

Programs on the server are started with x2goruncommand, which only run commands which are in the $PATH of the server. 

quote from man x2goruncommand:
"SYNOPSIS
       x2goruncommand <display> <agent_pid> <session_id> <command> <sound_system> <session_type>
<command>
              Execute command <command>. Full paths will be ignored, the command has to be in the server's $PATH."

In the code of x2goruncommand I can't find any hint on the locale.

The only way you can to give your locale to a program is to open a shell on the server, set the locale and start the program.

My solution for thunderbird is:

Delete the link /usr/bin/thunderbird on server.
Create a script /usr/bin/thunderbird

#!/bin/sh
export LC_ALL=de_DE.UTF-8
/usr/lib64/thunderbird/thunderbird

=> Should this bug be a feature request?