Commit 710a2553 by Thomas Tanaka

Timezone inside the container is not the same as the host

In OL6, it is missing /etc/sysconfig/clock Tested-by: 's avatarDeepak Patel <deepak.patel@oracle.com> Signed-off-by: 's avatarThomas Tanaka <thomas.tanaka@oracle.com>
parent 684753c2
......@@ -440,6 +440,31 @@ EOF
# start with a clean /var/log/messages
rm -f $container_rootfs/var/log/messages
# set initial timezone as on host
if [ -f /etc/sysconfig/clock ]; then
. /etc/sysconfig/clock
if [ $container_release_major = "5" -o $container_release_major = "6" ]; then
echo ZONE=$ZONE > $container_rootfs/etc/sysconfig/clock
chroot $container_rootfs tzdata-update
else
ZONE="${ZONE// /_}"
chroot $container_rootfs ln -sf ../usr/share/zoneinfo/$ZONE /etc/localtime
fi
else
ZONE=`readlink /etc/localtime | sed -s "s/\.\.\/usr\/share\/zoneinfo\///g"`
if [ "$ZONE" ]; then
if [ $container_release_major = "5" -o $container_release_major = "6" ]; then
echo ZONE=$ZONE > $container_rootfs/etc/sysconfig/clock
chroot $container_rootfs tzdata-update
else
# if /etc/localtime is a symlink, this should preserve it.
cp -a /etc/localtime $container_rootfs/etc/localtime
fi
else
echo "Timezone in container is not configured. Adjust it manually."
fi
fi
# add oracle user, set root password
chroot $container_rootfs useradd -m -s /bin/bash oracle
echo "oracle:oracle" | chroot $container_rootfs chpasswd
......
......@@ -291,6 +291,15 @@ EOF
# start with a clean /var/log/messages
rm -f $container_rootfs/var/log/messages
# set initial timezone as on host
if [ -f /etc/sysconfig/clock ]; then
. /etc/sysconfig/clock
echo ZONE=$ZONE > $container_rootfs/etc/sysconfig/clock
chroot $container_rootfs tzdata-update
else
echo "Timezone in container is not configured. Adjust it manually."
fi
# add oracle user, set root password
chroot $container_rootfs useradd -m -s /bin/bash oracle
echo "oracle:oracle" | chroot $container_rootfs chpasswd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment