From: funditus Date: Mon, 25 Nov 2013 15:03:43 +0000 (+0600) Subject: lxc-debian: Make timezone match the host X-Git-Tag: lxc-1.0.0.beta1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7365a247b7582f858fab6a92270c21e43973bf5;p=thirdparty%2Flxc.git lxc-debian: Make timezone match the host Set timezone in container as on the host Signed-off-by: funditus Acked-by: Stéphane Graber --- diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index cd69cebe8..0f0946a5a 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -93,6 +93,18 @@ EOF chroot $rootfs /usr/sbin/update-rc.d -f hwclock.sh remove chroot $rootfs /usr/sbin/update-rc.d -f hwclockfirst.sh remove + # set initial timezone as on host + if [ -f /etc/timezone ]; then + echo $(cat /etc/timezone) > $rootfs/etc/timezone + chroot $rootfs dpkg-reconfigure -f noninteractive tzdata + elif [ -f /etc/sysconfig/clock ]; then + source /etc/sysconfig/clock + echo $ZONE > $rootfs/etc/timezone + chroot $rootfs dpkg-reconfigure -f noninteractive tzdata + else + echo "Timezone in container is not configured. Adjust it manually." + fi + echo "root:root" | chroot $rootfs chpasswd echo "Root password is 'root', please change !"