From 5e37660d84aefdf049f1efb315237fa30f3c9587 Mon Sep 17 00:00:00 2001 From: nmoray Date: Mon, 26 Jun 2023 05:06:09 +0530 Subject: [PATCH] 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. --- dockers/docker-database/docker-database-init.sh | 4 ++++ dockers/docker-dhcp-relay/start.sh | 4 ++++ dockers/docker-eventd/start.sh | 3 +++ dockers/docker-fpm-frr/docker_init.sh | 4 ++++ dockers/docker-iccpd/start.sh | 4 ++++ dockers/docker-lldp/start.sh | 4 ++++ dockers/docker-macsec/start.sh | 4 ++++ dockers/docker-macsec/supervisord.conf | 11 +++++++++++ dockers/docker-mux/docker-init.sh | 4 ++++ dockers/docker-nat/start.sh | 4 ++++ dockers/docker-orchagent/docker-init.j2 | 4 ++++ dockers/docker-platform-monitor/docker_init.j2 | 4 ++++ dockers/docker-router-advertiser/docker-init.sh | 4 ++++ dockers/docker-sflow/Dockerfile.j2 | 1 + dockers/docker-sflow/start.sh | 5 +++++ dockers/docker-sflow/supervisord.conf | 11 +++++++++++ dockers/docker-snmp/start.sh | 4 ++++ dockers/docker-sonic-mgmt-framework/start.sh | 4 ++++ dockers/docker-sonic-p4rt/start.sh | 4 ++++ dockers/docker-sonic-telemetry/start.sh | 4 ++++ dockers/docker-teamd/start.sh | 4 ++++ rules/docker-database.mk | 1 + rules/docker-dhcp-relay.mk | 1 + rules/docker-eventd.mk | 1 + rules/docker-fpm-frr.mk | 1 + rules/docker-iccpd.mk | 1 + rules/docker-lldp.mk | 1 + rules/docker-macsec.mk | 1 + rules/docker-mux.mk | 1 + rules/docker-nat.mk | 1 + rules/docker-orchagent.mk | 1 + rules/docker-p4rt.mk | 1 + rules/docker-platform-monitor.mk | 1 + rules/docker-router-advertiser.mk | 1 + rules/docker-sflow.mk | 1 + rules/docker-snmp.mk | 1 + rules/docker-sonic-mgmt-framework.mk | 1 + rules/docker-teamd.mk | 1 + rules/docker-telemetry.mk | 1 + 39 files changed, 113 insertions(+) create mode 100644 dockers/docker-sflow/start.sh diff --git a/dockers/docker-database/docker-database-init.sh b/dockers/docker-database/docker-database-init.sh index e2c3fcb727d2..cee131b402d4 100755 --- a/dockers/docker-database/docker-database-init.sh +++ b/dockers/docker-database/docker-database-init.sh @@ -95,4 +95,8 @@ do fi done +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-dhcp-relay/start.sh b/dockers/docker-dhcp-relay/start.sh index 87a9e5711f2f..ce0dce10ed3c 100755 --- a/dockers/docker-dhcp-relay/start.sh +++ b/dockers/docker-dhcp-relay/start.sh @@ -10,6 +10,10 @@ then ${CTR_SCRIPT} -f dhcp_relay -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION} fi +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + # If our supervisor config has entries in the "dhcp-relay" group... if [ $(supervisorctl status | grep -c "^dhcp-relay:") -gt 0 ]; then # Wait for all interfaces to come up and be assigned IPv4 addresses before diff --git a/dockers/docker-eventd/start.sh b/dockers/docker-eventd/start.sh index 60cd6a00aecb..2c357a857436 100755 --- a/dockers/docker-eventd/start.sh +++ b/dockers/docker-eventd/start.sh @@ -4,3 +4,6 @@ if [ "${RUNTIME_OWNER}" == "" ]; then RUNTIME_OWNER="kube" fi +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index d8058e9b5d8d..5e25739b219e 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -106,4 +106,8 @@ chmod 0755 /usr/sbin/bgp-unisolate mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-iccpd/start.sh b/dockers/docker-iccpd/start.sh index bba5e490c466..cb36ce69cfff 100644 --- a/dockers/docker-iccpd/start.sh +++ b/dockers/docker-iccpd/start.sh @@ -10,3 +10,7 @@ sonic-cfggen -d -t /usr/share/sonic/templates/iccpd.j2 > $ICCPD_CONF_PATH/iccpd. mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-lldp/start.sh b/dockers/docker-lldp/start.sh index 5a489884aea9..51057ae4ec79 100755 --- a/dockers/docker-lldp/start.sh +++ b/dockers/docker-lldp/start.sh @@ -22,3 +22,7 @@ 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 diff --git a/dockers/docker-macsec/start.sh b/dockers/docker-macsec/start.sh index 20d602bdd370..bfb684eecadd 100644 --- a/dockers/docker-macsec/start.sh +++ b/dockers/docker-macsec/start.sh @@ -1,2 +1,6 @@ #!/usr/bin/env bash +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + diff --git a/dockers/docker-macsec/supervisord.conf b/dockers/docker-macsec/supervisord.conf index fb88f17049b2..3ab4f372f101 100644 --- a/dockers/docker-macsec/supervisord.conf +++ b/dockers/docker-macsec/supervisord.conf @@ -28,6 +28,17 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +[program:start] +command=/usr/bin/start.sh +priority=2 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running + [program:macsecmgrd] command=/usr/bin/macsecmgrd priority=2 diff --git a/dockers/docker-mux/docker-init.sh b/dockers/docker-mux/docker-init.sh index bea1686132a1..1679ec5d9f8f 100755 --- a/dockers/docker-mux/docker-init.sh +++ b/dockers/docker-mux/docker-init.sh @@ -3,6 +3,10 @@ # Generate supervisord config file mkdir -p /etc/supervisor/conf.d/ +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + # The docker container should start this script as PID 1, so now that supervisord is # properly configured, we exec supervisord so that it runs as PID 1 for the # duration of the container's lifetime diff --git a/dockers/docker-nat/start.sh b/dockers/docker-nat/start.sh index 68603d007a51..74912ce01485 100755 --- a/dockers/docker-nat/start.sh +++ b/dockers/docker-nat/start.sh @@ -3,3 +3,7 @@ rm -f /var/run/nat/* mkdir -p /var/warmboot/nat + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-orchagent/docker-init.j2 b/dockers/docker-orchagent/docker-init.j2 index bea9befc0b6f..1e8574de153b 100755 --- a/dockers/docker-orchagent/docker-init.j2 +++ b/dockers/docker-orchagent/docker-init.j2 @@ -70,4 +70,8 @@ if [ -f "$IS_SUPERVISOR" ]; then fi fi +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-platform-monitor/docker_init.j2 b/dockers/docker-platform-monitor/docker_init.j2 index c93d1790bd00..d8667296efae 100755 --- a/dockers/docker-platform-monitor/docker_init.j2 +++ b/dockers/docker-platform-monitor/docker_init.j2 @@ -110,4 +110,8 @@ else sonic-cfggen -d -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE fi +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + exec /usr/local/bin/supervisord diff --git a/dockers/docker-router-advertiser/docker-init.sh b/dockers/docker-router-advertiser/docker-init.sh index 6e1bb5545f82..02c5a8c72be1 100755 --- a/dockers/docker-router-advertiser/docker-init.sh +++ b/dockers/docker-router-advertiser/docker-init.sh @@ -14,4 +14,8 @@ 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 diff --git a/dockers/docker-sflow/Dockerfile.j2 b/dockers/docker-sflow/Dockerfile.j2 index 7399be80eed2..e8aee5fe6bed 100644 --- a/dockers/docker-sflow/Dockerfile.j2 +++ b/dockers/docker-sflow/Dockerfile.j2 @@ -26,6 +26,7 @@ RUN apt-get clean -y && \ RUN sed -ri '/^DAEMON_ARGS=""/c DAEMON_ARGS="-c /var/log/hsflowd.crash"' /etc/init.d/hsflowd +COPY ["start.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] diff --git a/dockers/docker-sflow/start.sh b/dockers/docker-sflow/start.sh new file mode 100644 index 000000000000..8996769c4c5e --- /dev/null +++ b/dockers/docker-sflow/start.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-sflow/supervisord.conf b/dockers/docker-sflow/supervisord.conf index 2c8b006df917..d6cd5092e53d 100644 --- a/dockers/docker-sflow/supervisord.conf +++ b/dockers/docker-sflow/supervisord.conf @@ -28,6 +28,17 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +[program:start] +command=/usr/bin/start.sh +priority=2 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running + [program:sflowmgrd] command=/usr/bin/sflowmgrd priority=2 diff --git a/dockers/docker-snmp/start.sh b/dockers/docker-snmp/start.sh index aefd0bfc3db6..6de6f740b0ad 100755 --- a/dockers/docker-snmp/start.sh +++ b/dockers/docker-snmp/start.sh @@ -27,3 +27,7 @@ sonic-cfggen $SONIC_CFGGEN_ARGS mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-sonic-mgmt-framework/start.sh b/dockers/docker-sonic-mgmt-framework/start.sh index d6722a27fc77..2fefbb349cb5 100755 --- a/dockers/docker-sonic-mgmt-framework/start.sh +++ b/dockers/docker-sonic-mgmt-framework/start.sh @@ -2,3 +2,7 @@ mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-sonic-p4rt/start.sh b/dockers/docker-sonic-p4rt/start.sh index d6722a27fc77..2fefbb349cb5 100755 --- a/dockers/docker-sonic-p4rt/start.sh +++ b/dockers/docker-sonic-p4rt/start.sh @@ -2,3 +2,7 @@ mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-sonic-telemetry/start.sh b/dockers/docker-sonic-telemetry/start.sh index 08f7292f55ba..8d36f740fa38 100755 --- a/dockers/docker-sonic-telemetry/start.sh +++ b/dockers/docker-sonic-telemetry/start.sh @@ -12,3 +12,7 @@ fi mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/dockers/docker-teamd/start.sh b/dockers/docker-teamd/start.sh index d67bc4e925c8..0b45239355ee 100755 --- a/dockers/docker-teamd/start.sh +++ b/dockers/docker-teamd/start.sh @@ -3,3 +3,7 @@ rm -f /var/run/teamd/* mkdir -p /var/warmboot/teamd + +TZ=$(cat /etc/timezone) +rm -rf /etc/localtime +ln -sf /usr/share/zoneinfo/$TZ /etc/localtime diff --git a/rules/docker-database.mk b/rules/docker-database.mk index b66583b9bd2c..a10609933c35 100644 --- a/rules/docker-database.mk +++ b/rules/docker-database.mk @@ -27,6 +27,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_DATABASE_DBG) $(DOCKER_DATABASE)_CONTAINER_NAME = database $(DOCKER_DATABASE)_RUN_OPT += --privileged -t $(DOCKER_DATABASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_DATABASE)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_DATABASE)_BASE_IMAGE_FILES += redis-cli:/usr/bin/redis-cli $(DOCKER_DATABASE)_FILES += $(SYSCTL_NET_CONFIG) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-dhcp-relay.mk b/rules/docker-dhcp-relay.mk index c26995ad143b..f5d58f2de45b 100644 --- a/rules/docker-dhcp-relay.mk +++ b/rules/docker-dhcp-relay.mk @@ -47,6 +47,7 @@ endif $(DOCKER_DHCP_RELAY)_CONTAINER_NAME = dhcp_relay $(DOCKER_DHCP_RELAY)_CONTAINER_PRIVILEGED = true $(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /etc/sonic:/etc/sonic:ro +$(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /etc/timezone:/etc/timezone:ro $(DOCKER_DHCP_RELAY)_CONTAINER_VOLUMES += /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_DHCP_RELAY)_CONTAINER_TMPFS += /tmp/ $(DOCKER_DHCP_RELAY)_CONTAINER_TMPFS += /var/tmp/ diff --git a/rules/docker-eventd.mk b/rules/docker-eventd.mk index 304f295e2a4b..367b0abecccd 100644 --- a/rules/docker-eventd.mk +++ b/rules/docker-eventd.mk @@ -33,6 +33,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_EVENTD_DBG) $(DOCKER_EVENTD)_CONTAINER_NAME = eventd $(DOCKER_EVENTD)_RUN_OPT += --privileged -t $(DOCKER_EVENTD)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_EVENTD)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro SONIC_BULLSEYE_DOCKERS += $(DOCKER_EVENTD) SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_EVENTD_DBG) diff --git a/rules/docker-fpm-frr.mk b/rules/docker-fpm-frr.mk index 79d5a927d20f..b672d85bac27 100644 --- a/rules/docker-fpm-frr.mk +++ b/rules/docker-fpm-frr.mk @@ -30,6 +30,7 @@ SONIC_DOCKER_DBG_IMAGES += $(DOCKER_FPM_FRR_DBG) $(DOCKER_FPM_FRR)_CONTAINER_NAME = bgp $(DOCKER_FPM_FRR)_RUN_OPT += --privileged -t $(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_FPM_FRR)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_FPM_FRR)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-iccpd.mk b/rules/docker-iccpd.mk index eb58ee755cdc..e9f280499847 100644 --- a/rules/docker-iccpd.mk +++ b/rules/docker-iccpd.mk @@ -23,6 +23,7 @@ endif $(DOCKER_ICCPD)_CONTAINER_NAME = iccpd $(DOCKER_ICCPD)_RUN_OPT += --privileged -t $(DOCKER_ICCPD)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_ICCPD)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_ICCPD)_BASE_IMAGE_FILES += mclagdctl:/usr/bin/mclagdctl diff --git a/rules/docker-lldp.mk b/rules/docker-lldp.mk index b2e7b350f3bb..9f6a4d2e711d 100644 --- a/rules/docker-lldp.mk +++ b/rules/docker-lldp.mk @@ -30,6 +30,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_LLDP_DBG) $(DOCKER_LLDP)_CONTAINER_NAME = lldp $(DOCKER_LLDP)_RUN_OPT += --privileged -t $(DOCKER_LLDP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_LLDP)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_LLDP)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_LLDP)_BASE_IMAGE_FILES += lldpctl:/usr/bin/lldpctl diff --git a/rules/docker-macsec.mk b/rules/docker-macsec.mk index d4cce3ecfcb7..49f80133b9bd 100644 --- a/rules/docker-macsec.mk +++ b/rules/docker-macsec.mk @@ -40,6 +40,7 @@ $(DOCKER_MACSEC)_VERSION = 1.0.0 $(DOCKER_MACSEC)_PACKAGE_NAME = macsec $(DOCKER_MACSEC)_RUN_OPT += --privileged -t $(DOCKER_MACSEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_MACSEC)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_MACSEC)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_MACSEC)_SERVICE_REQUIRES = updategraph diff --git a/rules/docker-mux.mk b/rules/docker-mux.mk index cbdc1c06510d..2f9f93a9b890 100644 --- a/rules/docker-mux.mk +++ b/rules/docker-mux.mk @@ -32,4 +32,5 @@ endif $(DOCKER_MUX)_CONTAINER_NAME = mux $(DOCKER_MUX)_RUN_OPT += --privileged -t $(DOCKER_MUX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_MUX)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_MUX)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-nat.mk b/rules/docker-nat.mk index 3d2f2b011968..f4022547ffef 100644 --- a/rules/docker-nat.mk +++ b/rules/docker-nat.mk @@ -31,6 +31,7 @@ endif $(DOCKER_NAT)_CONTAINER_NAME = nat $(DOCKER_NAT)_RUN_OPT += --privileged -t $(DOCKER_NAT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_NAT)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_NAT)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_NAT)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-orchagent.mk b/rules/docker-orchagent.mk index eae484ccc5f7..1e877aef4bdc 100644 --- a/rules/docker-orchagent.mk +++ b/rules/docker-orchagent.mk @@ -37,6 +37,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_ORCHAGENT_DBG) $(DOCKER_ORCHAGENT)_CONTAINER_NAME = swss $(DOCKER_ORCHAGENT)_RUN_OPT += --privileged -t $(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro +$(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro $(DOCKER_ORCHAGENT)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro $(DOCKER_ORCHAGENT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/rules/docker-p4rt.mk b/rules/docker-p4rt.mk index 172346742ce1..865bf9fee861 100644 --- a/rules/docker-p4rt.mk +++ b/rules/docker-p4rt.mk @@ -31,6 +31,7 @@ endif $(DOCKER_P4RT)_CONTAINER_NAME = p4rt $(DOCKER_P4RT)_RUN_OPT += --privileged -t $(DOCKER_P4RT)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_P4RT)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_P4RT)_GIT_COMMIT = $(shell cd "$($(SONIC_P4RT)_SRC_PATH)" && git log -n 1 --format=format:"%H %s" || echo "Unable to fetch git log for p4rt") $(DOCKER_P4RT)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index a87a30247337..daa19336fb6f 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -50,6 +50,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_PLATFORM_MONITOR_DBG) $(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --privileged -t $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /var/run/platform_cache:/var/run/platform_cache:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /usr/share/sonic/device/pddf:/usr/share/sonic/device/pddf:ro diff --git a/rules/docker-router-advertiser.mk b/rules/docker-router-advertiser.mk index 255ca00c01c7..e3f561be93dc 100644 --- a/rules/docker-router-advertiser.mk +++ b/rules/docker-router-advertiser.mk @@ -31,5 +31,6 @@ endif $(DOCKER_ROUTER_ADVERTISER)_CONTAINER_NAME = radv $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += --privileged -t $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_ROUTER_ADVERTISER)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_ROUTER_ADVERTISER)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/docker-sflow.mk b/rules/docker-sflow.mk index 285264dcb0b1..c5ca661f72c1 100644 --- a/rules/docker-sflow.mk +++ b/rules/docker-sflow.mk @@ -31,6 +31,7 @@ endif $(DOCKER_SFLOW)_CONTAINER_NAME = sflow $(DOCKER_SFLOW)_RUN_OPT += --privileged -t $(DOCKER_SFLOW)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SFLOW)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_SFLOW)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_SFLOW)_BASE_IMAGE_FILES += psample:/usr/bin/psample diff --git a/rules/docker-snmp.mk b/rules/docker-snmp.mk index 037d58936170..085eadf7eab3 100644 --- a/rules/docker-snmp.mk +++ b/rules/docker-snmp.mk @@ -30,6 +30,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SNMP_DBG) $(DOCKER_SNMP)_CONTAINER_NAME = snmp $(DOCKER_SNMP)_RUN_OPT += --privileged -t $(DOCKER_SNMP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SNMP)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_SNMP)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro $(DOCKER_SNMP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_SNMP)_BASE_IMAGE_FILES += monit_snmp:/etc/monit/conf.d diff --git a/rules/docker-sonic-mgmt-framework.mk b/rules/docker-sonic-mgmt-framework.mk index b0986e12d14e..7985f8e9be9d 100644 --- a/rules/docker-sonic-mgmt-framework.mk +++ b/rules/docker-sonic-mgmt-framework.mk @@ -31,6 +31,7 @@ endif $(DOCKER_MGMT_FRAMEWORK)_CONTAINER_NAME = mgmt-framework $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --privileged -t $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc:/host_etc:ro $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /var/run/dbus:/var/run/dbus:rw $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --mount type=bind,source="/var/platform/",target="/mnt/platform/" diff --git a/rules/docker-teamd.mk b/rules/docker-teamd.mk index 8d92cd2533f4..ae5cc838450d 100644 --- a/rules/docker-teamd.mk +++ b/rules/docker-teamd.mk @@ -35,6 +35,7 @@ endif $(DOCKER_TEAMD)_CONTAINER_NAME = teamd $(DOCKER_TEAMD)_RUN_OPT += --privileged -t $(DOCKER_TEAMD)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_TEAMD)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_TEAMD)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_TEAMD)_BASE_IMAGE_FILES += teamdctl:/usr/bin/teamdctl diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index 30e11d925195..5b66ff588b64 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -30,6 +30,7 @@ endif $(DOCKER_TELEMETRY)_CONTAINER_NAME = telemetry $(DOCKER_TELEMETRY)_RUN_OPT += --privileged -t $(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_TELEMETRY)_RUN_OPT += -v /usr/share/sonic/scripts:/usr/share/sonic/scripts:ro ifneq ($(INCLUDE_SYSTEM_GNMI), y) $(DOCKER_TELEMETRY)_RUN_OPT += -v /var/run/dbus:/var/run/dbus:rw