From 860cb265ac70aa718941756cdaf85274857e6698 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 21 Apr 2020 18:00:48 +0300 Subject: [PATCH] [PMON] Extend pmon daemon start control to lm-sensors and fancontrol (#4447) --- .../mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json | 3 ++- .../docker-platform-monitor/docker-pmon.supervisord.conf.j2 | 4 ++++ dockers/docker-platform-monitor/start.sh.j2 | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) 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 44bad64942..d12b2100ee 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 @@ -1,4 +1,5 @@ { - "skip_ledd": true + "skip_ledd": true, + "skip_fancontrol": true } diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 21b508ab8f..87b6808a74 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -26,6 +26,7 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog +{% if not skip_sensors %} [program:lm-sensors] command=/usr/bin/lm-sensors.sh priority=3 @@ -34,7 +35,9 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog startsecs=0 +{% endif %} +{% if not skip_fancontrol %} [program:fancontrol] command=/usr/sbin/fancontrol priority=4 @@ -43,6 +46,7 @@ autorestart=unexpected stdout_logfile=syslog stderr_logfile=syslog startsecs=10 +{% endif %} {% if not skip_ledd %} [program:ledd] diff --git a/dockers/docker-platform-monitor/start.sh.j2 b/dockers/docker-platform-monitor/start.sh.j2 index a72f4fa8eb..03e0b49b8c 100644 --- a/dockers/docker-platform-monitor/start.sh.j2 +++ b/dockers/docker-platform-monitor/start.sh.j2 @@ -19,6 +19,7 @@ if [ -e /usr/share/sonic/platform/platform_wait ]; then fi fi +{% if not skip_sensors %} # If this platform has an lm-sensors config file, copy it to it's proper place # and start lm-sensors if [ -e /usr/share/sonic/platform/sensors.conf ]; then @@ -26,7 +27,9 @@ if [ -e /usr/share/sonic/platform/sensors.conf ]; then /bin/cp -f /usr/share/sonic/platform/sensors.conf /etc/sensors.d/ supervisorctl start lm-sensors fi +{% endif %} +{% if not skip_fancontrol %} # If this platform has a fancontrol config file, copy it to it's proper place # and start fancontrol if [ -e /usr/share/sonic/platform/fancontrol ]; then @@ -36,6 +39,7 @@ if [ -e /usr/share/sonic/platform/fancontrol ]; then /bin/cp -f /usr/share/sonic/platform/fancontrol /etc/ supervisorctl start fancontrol fi +{% endif %} # If the sonic-platform package is not installed, try to install it