Login shell sets LC_CTYPE=UTF-8

Bug #829314 reported by whoward
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
console-setup (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I'm using Ubuntu 10.04 LTS on several servers. On all of the servers the login shell sets LC_CTYPE=UTF-8. See the output below:

Ubuntu 10.04.3 LTS

Welcome to Ubuntu!
 * Documentation: https://help.ubuntu.com/
Last login: Fri Aug 19 04:15:31 2011 from localhost
root@gains:~# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.utf8
LC_CTYPE=UTF-8
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=
root@gains:~#

A LC_CTYPE=UTF-8 value generate rather annoying messages such as "Cannot set LC_CTYPE to default locale: No such file or directory".

However if I start a shell via "su -", the variable setting changes to LC_CTYPE="en_US.utf8". See below.

root@gains:~# su -
root@gains:~# locale
LANG=en_US.utf8
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=

The "su -" behavior is what I expect to be correct, since the contents of my "/etc/defaul/locale" file is:

root@gains:~# cat /etc/default/locale
LANG=en_US.utf8

Which from my understanding should mean that all the LC_* environment variables are set to match LANG.

Note this problem also manifests in bash tab completion for a non-privileged user, see below:

Ubuntu 10.04.3 LTS

Welcome to Ubuntu!
 * Documentation: https://help.ubuntu.com/
Last login: Fri Aug 19 03:28:55 2011 from localhost
warren@gains:~$ cd /-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

bin/ dev/ home/ lib32/ lost+found/ mnt/ proc/ sbin/ srv/ tmp/ var/
boot/ etc/ lib/ lib64/ media/ opt/ root/ selinux/ sys/ usr/
warren@gains:~$ cd /^C
warren@gains:~$ su - warren
Password:
warren@gains:~$ cd /
bin/ dev/ home/ lib32/ lost+found/ mnt/ proc/ sbin/ srv/ tmp/ var/
boot/ etc/ lib/ lib64/ media/ opt/ root/ selinux/ sys/ usr/
warren@gains:~$ cd /^C
warren@gains:~$

After "su -" tab completion now works.

I imagine that the work around would be to set the desired LC_CTYPE value in /etc/default/locale, but I'd kind of like Ubuntu (particularly LTS - which I use for server installs) to "just work".

Regards,

Warren.

affects: ubuntu → console-setup (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in console-setup (Ubuntu):
status: New → Confirmed
Revision history for this message
Fred (eldmannen+launchpad) wrote :
Revision history for this message
Jean-Luc Geering (jlgeering) wrote :

still seems to be the case ...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.