Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rsyslog plugin from all non eventd containers #21338

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

1 change: 0 additions & 1 deletion dockers/docker-config-engine-bookworm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ RUN pip3 install redis==5.0.1
COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"]
COPY ["files/readiness_probe.sh", "/usr/bin/"]
COPY ["files/container_startup.py", "/usr/share/sonic/scripts/"]
COPY ["00-load-omprog.conf", "/etc/rsyslog.d/"]

## Clean up
RUN apt-get purge -y \
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion dockers/docker-config-engine-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ RUN pip3 install redis==4.5.4
COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"]
COPY ["files/readiness_probe.sh", "/usr/bin/"]
COPY ["files/container_startup.py", "/usr/share/sonic/scripts/"]
COPY ["00-load-omprog.conf", "/etc/rsyslog.d/"]

## Clean up
RUN apt-get purge -y \
Expand Down
10 changes: 0 additions & 10 deletions dockers/docker-dhcp-relay/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,4 @@ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]
COPY ["cli", "/cli/"]

{% if include_system_eventd == "y" and build_reduce_image_size != "y" %}
# Copy regex json and rsyslog_plugin.conf file into rsyslog.d
COPY ["*.json", "/etc/rsyslog.d/"]
COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"]
# Create dhcp_relay_regex.conf
RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/dhcp_relay_events.conf
RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2
RUN rm -f /etc/rsyslog.d/events_info.json
{% endif %}

ENTRYPOINT ["/usr/bin/docker_init.sh"]
18 changes: 18 additions & 0 deletions dockers/docker-eventd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,27 @@ RUN apt-get clean -y && \
apt-get autoremove -y && \
rm -rf /debs

RUN mkdir -p /etc/rsyslog.d/rsyslog_plugin_conf

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"]
COPY ["*.json", "/etc/rsyslog.d/rsyslog_plugin_conf/"]
COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/rsyslog_plugin_conf/"]

RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin_conf/rsyslog_plugin.conf.j2 /etc/rsyslog.d/rsyslog_plugin_conf/host_events_info.json > /etc/rsyslog.d/rsyslog_plugin_conf/host_events.conf
RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin_conf/rsyslog_plugin.conf.j2 /etc/rsyslog.d/rsyslog_plugin_conf/bgp_events_info.json > /etc/rsyslog.d/rsyslog_plugin_conf/bgp_events.conf
RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin_conf/rsyslog_plugin.conf.j2 /etc/rsyslog.d/rsyslog_plugin_conf/dhcp_relay_events_info.json > /etc/rsyslog.d/rsyslog_plugin_conf/dhcp_relay_events.conf
RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin_conf/rsyslog_plugin.conf.j2 /etc/rsyslog.d/rsyslog_plugin_conf/swss_events_info.json > /etc/rsyslog.d/rsyslog_plugin_conf/swss_events.conf
RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin_conf/rsyslog_plugin.conf.j2 /etc/rsyslog.d/rsyslog_plugin_conf/syncd_events_info.json > /etc/rsyslog.d/rsyslog_plugin_conf/syncd_events.conf


RUN rm -f /etc/rsyslog.d/rsyslog_plugin_conf/rsyslog_plugin.conf.j2
RUN rm -f /etc/rsyslog.d/rsyslog_plugin_conf/host_events_info.json
RUN rm -f /etc/rsyslog.d/rsyslog_plugin_conf/bgp_events_info.json
RUN rm -f /etc/rsyslog.d/rsyslog_plugin_conf/dhcp_relay_events_info.json
RUN rm -f /etc/rsyslog.d/rsyslog_plugin_conf/swss_events_info.json
RUN rm -f /etc/rsyslog.d/rsyslog_plugin_conf/syncd_events_info.json

ENTRYPOINT ["/usr/local/bin/supervisord"]
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"name": "monit",
"parse_json": "monit_regex.json"
},
{
"name": "sshd",
"parse_json": "sshd_regex.json"
},
{
"name": "systemd",
"parse_json": "systemd_regex.json"
Expand Down
1 change: 0 additions & 1 deletion dockers/docker-eventd/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
if [ "${RUNTIME_OWNER}" == "" ]; then
RUNTIME_OWNER="kube"
fi

8 changes: 0 additions & 8 deletions dockers/docker-fpm-frr/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,4 @@ RUN chmod a+x /usr/bin/TSA && \
chmod a+x /usr/bin/TSC && \
chmod a+x /usr/bin/zsocket.sh

{% if include_system_eventd == "y" and build_reduce_image_size != "y" %}
COPY ["*.json", "/etc/rsyslog.d/"]
COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"]
RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/bgp_events.conf
RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2
RUN rm -f /etc/rsyslog.d/events_info.json
{% endif %}

ENTRYPOINT ["/usr/bin/docker_init.sh"]
10 changes: 0 additions & 10 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,4 @@ RUN sonic-cfggen -a "{\"ENABLE_ASAN\":\"{{ENABLE_ASAN}}\"}" -t /usr/share/sonic/
RUN rm -f /usr/share/sonic/templates/docker-init.j2
RUN chmod 755 /usr/bin/docker-init.sh

{% if include_system_eventd == "y" and build_reduce_image_size != "y" %}
# Copy all regex json files and rsyslog_plugin.conf to rsyslog.d
COPY ["*.json", "/etc/rsyslog.d/"]
COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"]
# 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
{% endif %}

ENTRYPOINT ["/usr/bin/docker-init.sh"]
7 changes: 7 additions & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,13 @@ function postStartAction()
docker cp $PSENSOR pmon:/usr/bin/
fi
fi
{%- elif docker_container_name == "eventd" %}
HOST_RSYSLOG_PLUGIN_CONF_FILE="/etc/rsyslog.d/host_events.conf"
if [ ! -f ${HOST_RSYSLOG_PLUGIN_CONF_FILE} ]; then
for f in $(docker exec -i eventd ls /etc/rsyslog.d/rsyslog_plugin_conf); do docker cp eventd:/etc/rsyslog.d/rsyslog_plugin_conf/$f /etc/rsyslog.d/; done
systemctl reset-failed rsyslog
systemctl restart rsyslog
fi
{%- else %}
: # nothing
{%- endif %}
Expand Down
4 changes: 2 additions & 2 deletions files/build_templates/eventd.service.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Unit]
Description=EVENTD container
Requires=config-setup.service
After=config-setup.service
Requires=rsyslog-config.service
After=rsyslog-config.service
BindsTo=sonic.target
After=sonic.target
StartLimitIntervalSec=1200
Expand Down
16 changes: 0 additions & 16 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -367,22 +367,6 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-db-cli_*.deb || \
# Install sonic-rsyslog-plugin
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-rsyslog-plugin_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f

# Generate host conf for rsyslog_plugin
j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/events_info.json | sudo tee $FILESYSTEM_ROOT_ETC/rsyslog.d/host_events.conf
sudo cp $BUILD_TEMPLATES/monit_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/
sudo cp $BUILD_TEMPLATES/sshd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/
sudo cp $BUILD_TEMPLATES/systemd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/
sudo cp $BUILD_TEMPLATES/kernel_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/
sudo cp $BUILD_TEMPLATES/dockerd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/
sudo cp $BUILD_TEMPLATES/seu_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/
sudo cp $BUILD_TEMPLATES/zebra_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/
sudo cp $BUILD_TEMPLATES/bgpd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/


j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/syncd_events_info.json | sudo tee $FILESYSTEM_ROOT_ETC/rsyslog.d/syncd_events.conf
sudo cp $BUILD_TEMPLATES/syncd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/

{% endif %}

# Install custom-built monit package and SONiC configuration files
Expand Down
7 changes: 0 additions & 7 deletions files/build_templates/sshd_regex.json

This file was deleted.

7 changes: 0 additions & 7 deletions files/build_templates/zebra_regex.json

This file was deleted.

6 changes: 0 additions & 6 deletions files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ $ModLoad omprog

if re_match($programname, "bgp[0-9]*#(frr|zebra|staticd|watchfrr)") then {
/var/log/frr/zebra.log
{% if include_system_eventd == "y" and build_reduce_image_size != "y" %}
action(type="omprog"
binary="/usr/bin/rsyslog_plugin -r /etc/rsyslog.d/zebra_regex.json -m sonic-events-bgp"
output="/var/log/rsyslog_plugin.log"
template="prog_msg")
{% endif %}
stop
}

Expand Down
4 changes: 2 additions & 2 deletions rules/docker-dhcp-relay.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ DOCKER_DHCP_RELAY_DBG = $(DOCKER_DHCP_RELAY_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_DHCP_RELAY)_PATH = $(DOCKERS_PATH)/$(DOCKER_DHCP_RELAY_STEM)

$(DOCKER_DHCP_RELAY)_DEPENDS += $(ISC_DHCP_RELAY) $(SONIC_DHCPMON) $(SONIC_DHCPRELAY) $(LIBSWSSCOMMON) $(SONIC_RSYSLOG_PLUGIN)
$(DOCKER_DHCP_RELAY)_DEPENDS += $(ISC_DHCP_RELAY) $(SONIC_DHCPMON) $(SONIC_DHCPRELAY) $(LIBSWSSCOMMON)

$(DOCKER_DHCP_RELAY)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)
$(DOCKER_DHCP_RELAY)_DBG_DEPENDS += $(ISC_DHCP_RELAY_DBG) $(SONIC_DHCPRELAY_DBG) $(SONIC_DHCPMON_DBG) $(SONIC_RSYSLOG_PLUGIN)
$(DOCKER_DHCP_RELAY)_DBG_DEPENDS += $(ISC_DHCP_RELAY_DBG) $(SONIC_DHCPRELAY_DBG) $(SONIC_DHCPMON_DBG)

$(DOCKER_DHCP_RELAY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)

Expand Down
2 changes: 1 addition & 1 deletion rules/docker-dhcp-server.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOCKER_DHCP_SERVER_DBG = $(DOCKER_DHCP_SERVER_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_DHCP_SERVER)_PATH = $(DOCKERS_PATH)/$(DOCKER_DHCP_SERVER_STEM)

$(DOCKER_DHCP_SERVER)_DEPENDS = $(LIBSWSSCOMMON) $(SONIC_RSYSLOG_PLUGIN)
$(DOCKER_DHCP_SERVER)_DEPENDS = $(LIBSWSSCOMMON)
$(DOCKER_DHCP_SERVER)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)

$(DOCKER_DHCP_SERVER)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)
Expand Down
2 changes: 1 addition & 1 deletion rules/docker-eventd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $(DOCKER_EVENTD)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
$(DOCKER_EVENTD)_CONTAINER_NAME = eventd
$(DOCKER_EVENTD)_RUN_OPT += -t
$(DOCKER_EVENTD)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_EVENTD)_RUN_OPT += -v /etc/localtime:/etc/localtime:ro
$(DOCKER_EVENTD)_RUN_OPT += -v /etc/localtime:/etc/localtime:ro

SONIC_BOOKWORM_DOCKERS += $(DOCKER_EVENTD)
SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_EVENTD_DBG)
4 changes: 2 additions & 2 deletions rules/docker-fpm-frr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ DOCKER_FPM_FRR_DBG = $(DOCKER_FPM_FRR_STEM)-$(DBG_IMAGE_MARK).gz
$(DOCKER_FPM_FRR)_PATH = $(DOCKERS_PATH)/$(DOCKER_FPM_FRR_STEM)
$(DOCKER_FPM_FRR)_PYTHON_WHEELS += $(SONIC_BGPCFGD) $(SONIC_FRR_MGMT_FRAMEWORK)

$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS) $(LIBYANG2) $(SONIC_RSYSLOG_PLUGIN)
$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS) $(LIBYANG2)
$(DOCKER_FPM_FRR)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_DEPENDS)
$(DOCKER_FPM_FRR)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) \
$(FRR_DBG) $(FRR_SNMP_DBG) $(LIBYANG2_DBG) $(SONIC_RSYSLOG_PLUGIN)
$(FRR_DBG) $(FRR_SNMP_DBG) $(LIBYANG2_DBG)

$(DOCKER_FPM_FRR)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_IMAGE_PACKAGES)

Expand Down
5 changes: 2 additions & 3 deletions rules/docker-orchagent.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DOCKER_ORCHAGENT_STEM = docker-orchagent
DOCKER_ORCHAGENT = $(DOCKER_ORCHAGENT_STEM).gz
DOCKER_ORCHAGENT_DBG = $(DOCKER_ORCHAGENT_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS) $(SONIC_RSYSLOG_PLUGIN)
$(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS)

ifeq ($(ENABLE_ASAN), y)
$(DOCKER_ORCHAGENT)_DEPENDS += $(SWSS_DBG)
Expand All @@ -13,8 +13,7 @@ endif
$(DOCKER_ORCHAGENT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_DEPENDS)
$(DOCKER_ORCHAGENT)_DBG_DEPENDS += $(SWSS_DBG) \
$(LIBSWSSCOMMON_DBG) \
$(LIBSAIREDIS_DBG) \
$(SONIC_RSYSLOG_PLUGIN)
$(LIBSAIREDIS_DBG)
$(DOCKER_ORCHAGENT)_PYTHON_WHEELS += $(SCAPY)

$(DOCKER_ORCHAGENT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_IMAGE_PACKAGES)
Expand Down
Loading