sonic-buildimage/dockers/docker-lldp/start.sh
nmoray f978b2bb53
Timezone sync issue between the host and containers (#14000)
#### Why I did it
To fix the timezone sync issue between the containers and the host. If a certain timezone has been configured on the host (SONIC) then the expectation is to reflect the same across all the containers.

This will fix [Issue:13046](https://github.com/sonic-net/sonic-buildimage/issues/13046).

For instance, a PST timezone has been set on the host and if the user checks the link flap logs (inside the FRR), it shows the UTC timestamp. Ideally, it should be PST.
2023-06-25 16:36:09 -07:00

29 lines
691 B
Bash
Executable File

#!/usr/bin/env bash
CFGGEN_PARAMS=" \
-d \
-t /usr/share/sonic/templates/lldpd.conf.j2 \
-y /etc/sonic/sonic_version.yml \
-t /usr/share/sonic/templates/lldpdSysDescr.conf.j2 \
"
if [ "${RUNTIME_OWNER}" == "" ]; then
RUNTIME_OWNER="kube"
fi
CTR_SCRIPT="/usr/share/sonic/scripts/container_startup.py"
if test -f ${CTR_SCRIPT}
then
${CTR_SCRIPT} -f lldp -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION}
fi
sonic-cfggen $CFGGEN_PARAMS > /etc/lldpd.conf
mkdir -p /var/sonic
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
rm -f /var/run/lldpd.socket
TZ=$(cat /etc/timezone)
rm -rf /etc/localtime
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime