From a230a484111bbec83f4babf96af646990c491b51 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 8 May 2013 15:30:49 -0300 Subject: [PATCH] Force container locales to be "en_US.UTF-8" regardless of host's $LANG --- boxes/debian/lxc-template | 17 +++++++---------- boxes/ubuntu/lxc-template | 9 ++------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/boxes/debian/lxc-template b/boxes/debian/lxc-template index 78eac8f..d926857 100755 --- a/boxes/debian/lxc-template +++ b/boxes/debian/lxc-template @@ -66,17 +66,14 @@ EOF $hostname EOF - # reconfigure some services - if [ ! -z "${LANG}" ]; then - # set default locale - cat < $rootfs/etc/locale.gen -${LANG} UTF-8 + # set default locale + cat < $rootfs/etc/locale.gen +en_US.UTF-8 UTF-8 EOF - echo "default locale set to ${LANG} UTF-8" - chroot $rootfs locale-gen ${LANG} > /dev/null 2>&1 - chroot $rootfs update-locale LANG=${LANG} - echo 'update-locale done' - fi + echo "default locale set to en_US.UTF-8 UTF-8" + chroot $rootfs locale-gen 'en_US.UTF-8' > /dev/null 2>&1 + chroot $rootfs update-locale LANG='en_US.UTF-8' + echo 'update-locale done' # remove pointless services in a container chroot $rootfs /usr/sbin/update-rc.d -f checkroot.sh remove diff --git a/boxes/ubuntu/lxc-template b/boxes/ubuntu/lxc-template index 07ae7ff..c56b290 100755 --- a/boxes/ubuntu/lxc-template +++ b/boxes/ubuntu/lxc-template @@ -84,13 +84,8 @@ EOF fi # make sure we have the current locale defined in the container - if [ -z "$LANG" ]; then - chroot $rootfs locale-gen en_US.UTF-8 - chroot $rootfs update-locale LANG=en_US.UTF-8 - else - chroot $rootfs locale-gen $LANG - chroot $rootfs update-locale LANG=$LANG - fi + chroot $rootfs locale-gen en_US.UTF-8 + chroot $rootfs update-locale LANG=en_US.UTF-8 return 0 }