|
3 | 3 | # Generate supervisord config file and the start.sh scripts
|
4 | 4 | mkdir -p /etc/supervisor/conf.d/
|
5 | 5 |
|
| 6 | +SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf" |
| 7 | +FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol" |
6 | 8 |
|
7 | 9 | HAVE_SENSORS_CONF=0
|
8 | 10 | HAVE_FANCONTROL_CONF=0
|
9 | 11 |
|
10 |
| -if [ -e /usr/share/sonic/platform/sensors.conf ]; then |
| 12 | +if [ -e $SENSORS_CONF_FILE ]; then |
11 | 13 | HAVE_SENSORS_CONF=1
|
12 | 14 | fi
|
13 | 15 |
|
14 |
| -if [ -e /usr/share/sonic/platform/fancontrol ]; then |
| 16 | +if [ -e $FANCONTROL_CONF_FILE ]; then |
15 | 17 | HAVE_FANCONTROL_CONF=1
|
16 | 18 | fi
|
17 | 19 |
|
|
24 | 26 | sonic-cfggen -a "$confvar" -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
|
25 | 27 | fi
|
26 | 28 |
|
27 |
| -# If this platform has an lm-sensors config file, copy it to it's proper place. |
28 |
| -if [ -e /usr/share/sonic/platform/sensors.conf ]; then |
| 29 | +# If this platform has an lm-sensors config file, copy it to its proper place |
| 30 | +if [ $HAVE_SENSORS_CONF -eq 1 ]; then |
29 | 31 | mkdir -p /etc/sensors.d
|
30 |
| - /bin/cp -f /usr/share/sonic/platform/sensors.conf /etc/sensors.d/ |
| 32 | + /bin/cp -f $SENSORS_CONF_FILE /etc/sensors.d/ |
31 | 33 | fi
|
32 | 34 |
|
33 |
| -# If this platform has a fancontrol config file, copy it to it's proper place |
34 |
| -# and start fancontrol |
35 |
| -if [ -e /usr/share/sonic/platform/fancontrol ]; then |
| 35 | +# If this platform has a fancontrol config file, copy it to its proper place |
| 36 | +if [ $HAVE_FANCONTROL_CONF -eq 1 ]; then |
36 | 37 | # Remove stale pid file if it exists
|
37 | 38 | rm -f /var/run/fancontrol.pid
|
38 | 39 |
|
39 |
| - /bin/cp -f /usr/share/sonic/templates/fancontrol.conf /etc/supervisord/conf.d/ |
| 40 | + /bin/cp -f $FANCONTROL_CONF_FILE /etc/ |
40 | 41 | fi
|
41 | 42 |
|
42 | 43 | exec /usr/bin/supervisord
|
0 commit comments