locale-gen does not work in LXC container

Bug #931717 reported by Ben Howard
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
langpack-locales (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Running locale-gen under a LXC container does not work..running it under a non-LXC container works.

Steps to repoduce:
1. For convience, run "lxc-create -t ubuntu-cloud -n locale-test"
2. Start you instance, "lxc-create -n locale-test"
3. Login in as "ubuntu", password "ubuntu"
4. Run "sudo locale-gen -

ubuntu@t1:/tmp$ sudo locale-gen en_US.UTF-8
Generating locales...
  en_US.UTF-8... cannot read archive header: No such file or directory
failed
Generation complete.

Looking at an strace ( strace -f -ff -o /tmp/test locale-gen en_US-UTF-8) yields:
open("/usr/lib/locale/locale-archive.TcQNQv", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
write(3, "\t\1\2\336\0\0\0\0008\0\0\0\0\0\0\0\213\3\0\0\274*\0\0\0\0\0\0L\35\0\0"..., 56) = 56
ftruncate(3, 103860) = 0
mmap(NULL, 536870912, PROT_NONE, MAP_SHARED, 3, 0) = 0x7f79fcfae000
mmap(0x7f79fcfae000, 103860, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 3, 0) = 0x7f79fcfae000
link("/usr/lib/locale/locale-archive.TcQNQv", "/usr/lib/locale/locale-archive") = 0
unlink("/usr/lib/locale/locale-archive.TcQNQv") = 0
fchmod(3, 0644) = -1 ENOENT (No such file or directory)
unlink("/usr/lib/locale/locale-archive") = 0
write(2, "cannot change mode of new locale"..., 40) = 40
write(2, ": No such file or directory", 27) = 27
write(2, "\n", 1) = 1

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libc-bin 2.15-0ubuntu2
ProcVersionSignature: User Name 3.2.0-15.24-generic 3.2.5
Uname: Linux 3.2.0-15-generic x86_64
NonfreeKernelModules: veth pci_stub vboxpci vboxnetadp vboxnetflt vboxdrv hdaps ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ip_tables x_tables bridge stp kvm_intel kvm rfcomm bnep bluetooth deflate zlib_deflate ctr twofish_generic twofish_x86_64_3way twofish_x86_64 twofish_common camellia serpent parport_pc blowfish_generic blowfish_x86_64 blowfish_common ppdev cast5 des_generic xcbc rmd160 sha512_generic crypto_null af_key binfmt_misc dm_crypt nvidia snd_hda_codec_hdmi arc4 snd_hda_codec_conexant snd_hda_intel uvcvideo joydev videodev snd_hda_codec hid_logitech_dj v4l2_compat_ioctl32 thinkpad_acpi dm_multipath iwlwifi snd_seq_midi snd_rawmidi snd_hwdep snd_seq_midi_event mei psmouse mac80211 serio_raw snd_seq snd_pcm snd_seq_device snd_timer snd_page_alloc mac_hid snd cfg80211 soundcore wmi nvram lp parport tp_smapi thinkpad_ec dm_raid45 xor dm_mirror dm_region_hash dm_log vesafb usbhid hid sdhci_pci sdhci e1000e video zram usb_storage
ApportVersion: 1.91-0ubuntu1
Architecture: amd64
Date: Mon Feb 13 21:24:43 2012
Dependencies:

ProcEnviron: SHELL=/bin/bash
SourcePackage: eglibc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :
Matthias Klose (doko)
affects: eglibc (Ubuntu) → langpack-locales (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in langpack-locales (Ubuntu):
status: New → Confirmed
Revision history for this message
Andre Tomt (andre-tomt) wrote :

Apparmor reports this:

[235069.803869] type=1400 audit(1329758407.826:37): apparmor="DENIED" operation="chmod" info="Failed name lookup - deleted entry" error=-2 parent=26483 profile="/usr/bin/lxc-start//lxc_container" name="/usr/lib/locale/locale-archive.cYcWvi" pid=26503 comm="localedef" requested_mask="w" denied_mask="w" fsuid=0 ouid=0

Reading the strace, it does try to fchmod a fd for a file it has unlinked.
I wonder how that is supposed to work.. Bug in libc-bin?

Revision history for this message
Andre Tomt (andre-tomt) wrote :

Note that unloading the apparmor profiles (as a temporary measure of course) workarounds this problem.

Revision history for this message
JP Viljoen (froztbyte) wrote :

Please check https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/969299/comments/6 for a solution to this. I'll also mark this bug as a duplicate of 969299.

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

Other bug subscribers

Bug attachments

Remote bug watches

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