From bc919827ac214d3aee1f7d22502c85b461e84ab1 Mon Sep 17 00:00:00 2001 From: zhengweitang Date: Sat, 12 Oct 2024 11:10:34 +0800 Subject: [PATCH] sync docker-orchagent modifications --- dockers/docker-orchagent-ot/Dockerfile.j2 | 10 ++++++---- dockers/docker-orchagent-ot/docker-init.j2 | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dockers/docker-orchagent-ot/Dockerfile.j2 b/dockers/docker-orchagent-ot/Dockerfile.j2 index 01acf74f4da6..d350e2d00fe1 100755 --- a/dockers/docker-orchagent-ot/Dockerfile.j2 +++ b/dockers/docker-orchagent-ot/Dockerfile.j2 @@ -63,9 +63,11 @@ RUN sonic-cfggen -t /usr/share/sonic/templates/docker-init.j2 > /usr/bin/docker- RUN rm -f /usr/share/sonic/templates/docker-init.j2 RUN chmod 755 /usr/bin/docker-init.sh -# Create swss rsyslog_plugin conf file -RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/swss_events.conf -RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 -RUN rm -f /etc/rsyslog.d/events_info.json +RUN mkdir -p /usr/share/sonic/templates/rsyslog_plugin + +# Copy rsyslog plugin configuration file and regexes to docker +COPY ["swss_regex.json", "/etc/rsyslog.d/"] +COPY ["events_info.json", "/usr/share/sonic/templates/rsyslog_plugin/"] +COPY ["files/rsyslog_plugin.conf.j2", "/usr/share/sonic/templates/rsyslog_plugin/"] ENTRYPOINT ["/usr/bin/docker-init.sh"] diff --git a/dockers/docker-orchagent-ot/docker-init.j2 b/dockers/docker-orchagent-ot/docker-init.j2 index 82c64c75c876..497eef559758 100755 --- a/dockers/docker-orchagent-ot/docker-init.j2 +++ b/dockers/docker-orchagent-ot/docker-init.j2 @@ -29,4 +29,7 @@ TZ=$(cat /etc/timezone) rm -rf /etc/localtime ln -sf /usr/share/zoneinfo/$TZ /etc/localtime +export EVENTD_STATE=$(sonic-db-cli -s CONFIG_DB HGET 'FEATURE|eventd' 'state') +j2 -f json --import-env=ENVIRONMENT /usr/share/sonic/templates/rsyslog_plugin/rsyslog_plugin.conf.j2 /usr/share/sonic/templates/rsyslog_plugin/events_info.json > /etc/rsyslog.d/swss_events.conf + exec /usr/local/bin/supervisord