From f7365a247b7582f858fab6a92270c21e43973bf5 Mon Sep 17 00:00:00 2001 From: funditus Date: Mon, 25 Nov 2013 21:03:43 +0600 Subject: [PATCH] lxc-debian: Make timezone match the host MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Set timezone in container as on the host Signed-off-by: funditus Acked-by: Stéphane Graber --- templates/lxc-debian.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 !" -- 2.47.2