From c02206652290268f3fdf6de7b2a0277ab6c443fb Mon Sep 17 00:00:00 2001 From: longhuan-cisco <84595962+longhuan-cisco@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:39:13 -0700 Subject: [PATCH] Add enable_sff_mgr flag support for xcvrd (#18054) This PR is a dependency of sonic-net/sonic-platform-daemons#383 HLD of sff_mgr: sonic-net/SONiC#1371 Why I did it Add enable_xcvrd_sff_mgr flag support for sff_mgr --- .../docker-pmon.supervisord.conf.j2 | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 3cb5f0509a..4673b62da6 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -95,13 +95,23 @@ dependent_startup_wait_for=rsyslogd:running {% if not skip_xcvrd %} [program:xcvrd] +{% set base_command = "python3 /usr/local/bin/xcvrd" %} +{% set options = "" -%} + +{% if skip_xcvrd_cmis_mgr %} + {%- set options = options + " --skip_cmis_mgr" %} +{% endif -%} + +{% if enable_xcvrd_sff_mgr %} + {%- set options = options + " --enable_sff_mgr" %} +{% endif -%} + {% if delay_xcvrd %} -command={% if skip_xcvrd_cmis_mgr %} bash -c "sleep 30 && python3 /usr/local/bin/xcvrd --skip_cmis_mgr" {% else %} bash -c "sleep 30 && python3 /usr/local/bin/xcvrd" {% endif %} - + {%- set command = "bash -c \"sleep 30 && " ~ base_command ~ options ~ "\"" %} {% else %} -command={% if skip_xcvrd_cmis_mgr %} python3 /usr/local/bin/xcvrd --skip_cmis_mgr {% else %} python3 /usr/local/bin/xcvrd {% endif %} - -{% endif %} + {%- set command = base_command ~ options %} +{% endif -%} +command={{ command }} priority=6 autostart=false autorestart=unexpected