Skip to content

[docker-platform-monitor] Fix copy of fancontrol config file #5037

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

Merged
merged 1 commit into from
Jul 28, 2020
Merged
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
19 changes: 10 additions & 9 deletions dockers/docker-platform-monitor/docker_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
# Generate supervisord config file and the start.sh scripts
mkdir -p /etc/supervisor/conf.d/

SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf"
FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol"

HAVE_SENSORS_CONF=0
HAVE_FANCONTROL_CONF=0

if [ -e /usr/share/sonic/platform/sensors.conf ]; then
if [ -e $SENSORS_CONF_FILE ]; then
HAVE_SENSORS_CONF=1
fi

if [ -e /usr/share/sonic/platform/fancontrol ]; then
if [ -e $FANCONTROL_CONF_FILE ]; then
HAVE_FANCONTROL_CONF=1
fi

Expand All @@ -24,19 +26,18 @@ else
sonic-cfggen -a "$confvar" -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
fi

# If this platform has an lm-sensors config file, copy it to it's proper place.
if [ -e /usr/share/sonic/platform/sensors.conf ]; then
# If this platform has an lm-sensors config file, copy it to its proper place
if [ $HAVE_SENSORS_CONF -eq 1 ]; then
mkdir -p /etc/sensors.d
/bin/cp -f /usr/share/sonic/platform/sensors.conf /etc/sensors.d/
/bin/cp -f $SENSORS_CONF_FILE /etc/sensors.d/
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
# If this platform has a fancontrol config file, copy it to its proper place
if [ $HAVE_FANCONTROL_CONF -eq 1 ]; then
# Remove stale pid file if it exists
rm -f /var/run/fancontrol.pid

/bin/cp -f /usr/share/sonic/templates/fancontrol.conf /etc/supervisord/conf.d/
/bin/cp -f $FANCONTROL_CONF_FILE /etc/
fi

exec /usr/bin/supervisord