sonic-buildimage/dockers/docker-router-advertiser/docker-init.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

22 lines
707 B
Bash
Executable File

#!/usr/bin/env bash
mkdir -p /etc/supervisor/conf.d
# Generate supervisord router advertiser config, /etc/radvd.conf config file, and
# the script that waits for pertinent interfaces to come up and make it executable
CFGGEN_PARAMS=" \
-d \
-t /usr/share/sonic/templates/docker-router-advertiser.supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \
-t /usr/share/sonic/templates/radvd.conf.j2,/etc/radvd.conf \
-t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \
"
sonic-cfggen $CFGGEN_PARAMS
chmod +x /usr/bin/wait_for_link.sh
TZ=$(cat /etc/timezone)
rm -rf /etc/localtime
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
exec /usr/local/bin/supervisord