From 4be2d9a75242319db412dcf35cb34ca673a1d7f9 Mon Sep 17 00:00:00 2001 From: Yuanzhe Liu Date: Tue, 2 Apr 2024 11:06:03 +0300 Subject: [PATCH] Delay pmon non-critical daemon Signed-off-by: Yuanzhe, Liu --- .../pmon_daemon_control.json | 3 ++- dockers/docker-platform-monitor/delay.py | 4 ++++ .../docker-pmon.supervisord.conf.j2 | 19 ++++++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 dockers/docker-platform-monitor/delay.py diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json index dbc19c9baabf..8ffea7b92f8e 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json @@ -2,6 +2,7 @@ "skip_ledd": true, "skip_fancontrol": true, "delay_xcvrd": true, - "skip_xcvrd_cmis_mgr": true + "skip_xcvrd_cmis_mgr": true, + "delay_non_critical_daemon": true } diff --git a/dockers/docker-platform-monitor/delay.py b/dockers/docker-platform-monitor/delay.py new file mode 100644 index 000000000000..56918b0e6ac5 --- /dev/null +++ b/dockers/docker-platform-monitor/delay.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 + +from swsscommon.swsscommon import RestartWaiter +RestartWaiter.waitAdvancedBootDone() diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 4673b62da6e5..b081175e3c6c 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -28,6 +28,15 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +{% if delay_non_critical_daemon %} +[program:delay] +command=python3 /usr/bin/delay.py +autostart=false +autorestart=false +startsecs=0 +dependent_startup=true +{% endif %} + {% if not skip_chassisd and IS_MODULAR_CHASSIS == 1 %} [program:chassisd] command=/usr/local/bin/chassisd @@ -64,7 +73,7 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=0 dependent_startup=true -dependent_startup_wait_for=rsyslogd:running +dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %} {% endif %} {% if not skip_fancontrol and HAVE_FANCONTROL_CONF == 1 %} @@ -151,7 +160,7 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=10 dependent_startup=true -dependent_startup_wait_for=rsyslogd:running +dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %} {% endif %} {% if not skip_syseepromd %} @@ -164,7 +173,7 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=10 dependent_startup=true -dependent_startup_wait_for=rsyslogd:running +dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %} {% endif %} {% if not skip_thermalctld %} @@ -178,7 +187,7 @@ stderr_logfile=syslog startsecs=10 startretries=50 dependent_startup=true -dependent_startup_wait_for=rsyslogd:running +dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %} {% endif %} {% if not skip_pcied %} @@ -204,5 +213,5 @@ stdout_logfile=syslog stderr_logfile=syslog startsecs=10 dependent_startup=true -dependent_startup_wait_for=rsyslogd:running +dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %} {% endif %}