Skip to content

Commit ade34bf

Browse files
authored
[Bookworm] Fix timezone propagation to containers (#21079)
- Why I did it Fix #20925 Not cherry-pickable to 202405, will raise a separate PR - How I did it Mount /etc/localtime on containers and remove /etc/timezone dependency - How to verify it root@sonic:/home/admin# zdump /etc/localtime /etc/localtime Fri Dec 6 23:24:03 2024 IST root@sonic:/home/admin# docker exec swss zdump /etc/localtime /etc/localtime Fri Dec 6 23:24:12 2024 IST Verify swss.rec/sairedis.rec and syslog are following same time Signed-off-by: Vivek <[email protected]>
1 parent c0ff067 commit ade34bf

File tree

45 files changed

+21
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+21
-124
lines changed

dockers/docker-database/docker-database-init.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ do
133133
chown -R redis:redis /var/lib/$inst
134134
done
135135

136-
TZ=$(cat /etc/timezone)
137-
rm -rf /etc/localtime
138-
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
139-
140136
chown -R redis:redis $REDIS_DIR
141137
REDIS_BMP_DIR="/var/lib/redis_bmp"
142138
chown -R redis:redis $REDIS_BMP_DIR

dockers/docker-dhcp-relay/start.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ then
1010
${CTR_SCRIPT} -f dhcp_relay -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION}
1111
fi
1212

13-
TZ=$(cat /etc/timezone)
14-
rm -rf /etc/localtime
15-
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
16-
1713
# If our supervisor config has entries in the "dhcp-relay" group...
1814
if [ $(supervisorctl status | grep -c "^dhcp-relay:") -gt 0 ]; then
1915
# Wait for all interfaces to come up and be assigned IPv4 addresses before

dockers/docker-dhcp-server/start.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,3 @@ if test -f ${CTR_SCRIPT}
1313
then
1414
${CTR_SCRIPT} -f dhcp_server -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION}
1515
fi
16-
17-
TZ=$(cat /etc/timezone)
18-
rm -rf /etc/localtime
19-
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime

dockers/docker-eventd/start.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ if [ "${RUNTIME_OWNER}" == "" ]; then
44
RUNTIME_OWNER="kube"
55
fi
66

7-
TZ=$(cat /etc/timezone)
8-
rm -rf /etc/localtime
9-
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime

dockers/docker-fpm-frr/docker_init.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,4 @@ chmod 0755 /usr/sbin/bgp-unisolate
108108
mkdir -p /var/sonic
109109
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
110110

111-
TZ=$(cat /etc/timezone)
112-
rm -rf /etc/localtime
113-
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
114-
115111
exec /usr/local/bin/supervisord

dockers/docker-iccpd/start.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ sonic-cfggen -d -t /usr/share/sonic/templates/iccpd.j2 > $ICCPD_CONF_PATH/iccpd.
1111
mkdir -p /var/sonic
1212
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
1313

14-
TZ=$(cat /etc/timezone)
15-
rm -rf /etc/localtime
16-
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime

dockers/docker-lldp/start.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,3 @@ mkdir -p /var/sonic
2323
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
2424

2525
rm -f /var/run/lldpd.socket
26-
27-
TZ=$(cat /etc/timezone)
28-
rm -rf /etc/localtime
29-
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime

dockers/docker-macsec/Dockerfile.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ RUN apt-get clean -y && \
2121
apt-get autoremove -y && \
2222
rm -rf /debs
2323

24-
COPY ["start.sh", "/usr/bin/"]
2524
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
2625
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
2726
COPY ["critical_processes", "/etc/supervisor"]

dockers/docker-macsec/start.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

dockers/docker-macsec/supervisord.conf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@ stdout_logfile=syslog
2828
stderr_logfile=syslog
2929
dependent_startup=true
3030

31-
[program:start]
32-
command=/usr/bin/start.sh
33-
priority=2
34-
autostart=false
35-
autorestart=false
36-
startsecs=0
37-
stdout_logfile=syslog
38-
stderr_logfile=syslog
39-
dependent_startup=true
40-
dependent_startup_wait_for=rsyslogd:running
41-
4231
[program:macsecmgrd]
4332
command=/usr/bin/macsecmgrd
4433
priority=2

0 commit comments

Comments
 (0)