From 22819d9983cdad5d331422c6dd12e151fe2b14ad Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 23 Jun 2017 15:23:00 -0700 Subject: [PATCH] [docker-platform-monitor]: Add fancontrol (#735) --- dockers/docker-platform-monitor/Dockerfile.j2 | 3 ++- dockers/docker-platform-monitor/start.sh | 22 ++++++++++++++----- .../docker-platform-monitor/supervisord.conf | 10 ++++++++- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index 9b407bdef6..423181a3c5 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -6,7 +6,8 @@ ENV DEBIAN_FRONTEND=noninteractive # Update apt's package index files RUN apt-get update -RUN apt-get install -y python-pip sensord +# Install required packages +RUN apt-get install -y python-pip sensord fancontrol {% if docker_platform_monitor_debs.strip() %} # Copy built Debian packages diff --git a/dockers/docker-platform-monitor/start.sh b/dockers/docker-platform-monitor/start.sh index b550cc037a..cfcf17e4a1 100755 --- a/dockers/docker-platform-monitor/start.sh +++ b/dockers/docker-platform-monitor/start.sh @@ -1,16 +1,26 @@ #!/usr/bin/env bash -mkdir -p /etc/sensors.d -if [ -e /usr/share/sonic/platform/sensors.conf ]; then - /bin/cp -rf /usr/share/sonic/platform/sensors.conf /etc/sensors.d/ -fi - mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd -supervisorctl start lm-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 + mkdir -p /etc/sensors.d + /bin/cp -f /usr/share/sonic/platform/sensors.conf /etc/sensors.d/ + supervisorctl start lm-sensors +fi + +# 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 + /bin/cp -f /usr/share/sonic/platform/fancontrol /etc/ + supervisorctl start fancontrol +fi + supervisorctl start ledd diff --git a/dockers/docker-platform-monitor/supervisord.conf b/dockers/docker-platform-monitor/supervisord.conf index 051829eae6..2753dceb65 100644 --- a/dockers/docker-platform-monitor/supervisord.conf +++ b/dockers/docker-platform-monitor/supervisord.conf @@ -27,9 +27,17 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog +[program:fancontrol] +command=/usr/sbin/fancontrol +priority=4 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog + [program:ledd] command=/usr/bin/ledd -priority=6 +priority=5 autostart=false stdout_logfile=syslog stderr_logfile=syslog