[Pmon] dynamically load pmon daemons (#2654)
* dynamically load pmon daemons
This commit is contained in:
parent
60968cf95b
commit
84b46bb0e0
1
device/mellanox/x86_64-mlnx_lssn2700-r0/pmon_daemon_control.json
Symbolic link
1
device/mellanox/x86_64-mlnx_lssn2700-r0/pmon_daemon_control.json
Symbolic link
@ -0,0 +1 @@
|
||||
../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json
|
1
device/mellanox/x86_64-mlnx_msn2010-r0/pmon_daemon_control.json
Symbolic link
1
device/mellanox/x86_64-mlnx_msn2010-r0/pmon_daemon_control.json
Symbolic link
@ -0,0 +1 @@
|
||||
../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json
|
1
device/mellanox/x86_64-mlnx_msn2100-r0/pmon_daemon_control.json
Symbolic link
1
device/mellanox/x86_64-mlnx_msn2100-r0/pmon_daemon_control.json
Symbolic link
@ -0,0 +1 @@
|
||||
../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json
|
1
device/mellanox/x86_64-mlnx_msn2410-r0/pmon_daemon_control.json
Symbolic link
1
device/mellanox/x86_64-mlnx_msn2410-r0/pmon_daemon_control.json
Symbolic link
@ -0,0 +1 @@
|
||||
../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"skip_ledd": true
|
||||
}
|
||||
|
1
device/mellanox/x86_64-mlnx_msn2740-r0/pmon_daemon_control.json
Symbolic link
1
device/mellanox/x86_64-mlnx_msn2740-r0/pmon_daemon_control.json
Symbolic link
@ -0,0 +1 @@
|
||||
../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json
|
1
device/mellanox/x86_64-mlnx_msn3700-r0/pmon_daemon_control.json
Symbolic link
1
device/mellanox/x86_64-mlnx_msn3700-r0/pmon_daemon_control.json
Symbolic link
@ -0,0 +1 @@
|
||||
../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json
|
1
device/mellanox/x86_64-mlnx_msn3700c-r0/pmon_daemon_control.json
Symbolic link
1
device/mellanox/x86_64-mlnx_msn3700c-r0/pmon_daemon_control.json
Symbolic link
@ -0,0 +1 @@
|
||||
../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json
|
@ -55,7 +55,7 @@ RUN apt-get autoclean -y
|
||||
RUN apt-get autoremove -y
|
||||
RUN rm -rf /debs /python-wheels ~/.cache
|
||||
|
||||
COPY ["start.sh", "lm-sensors.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
COPY ["docker_init.sh", "lm-sensors.sh", "/usr/bin/"]
|
||||
COPY ["docker-pmon.supervisord.conf.j2", "start.sh.j2", "/usr/share/sonic/templates/"]
|
||||
|
||||
ENTRYPOINT ["/usr/bin/supervisord"]
|
||||
ENTRYPOINT ["/usr/bin/docker_init.sh"]
|
||||
|
@ -37,6 +37,7 @@ autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
|
||||
{% if not skip_ledd %}
|
||||
[program:ledd]
|
||||
command=/usr/bin/ledd
|
||||
priority=5
|
||||
@ -45,7 +46,9 @@ autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
startsecs=0
|
||||
{% endif %}
|
||||
|
||||
{% if not skip_xcvrd %}
|
||||
[program:xcvrd]
|
||||
command=/usr/bin/xcvrd
|
||||
priority=6
|
||||
@ -54,7 +57,9 @@ autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
startsecs=0
|
||||
{% endif %}
|
||||
|
||||
{% if not skip_psud %}
|
||||
[program:psud]
|
||||
command=/usr/bin/psud
|
||||
priority=7
|
||||
@ -63,4 +68,4 @@ autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
startsecs=0
|
||||
|
||||
{% endif %}
|
18
dockers/docker-platform-monitor/docker_init.sh
Executable file
18
dockers/docker-platform-monitor/docker_init.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Generate supervisord config file and the start.sh scripts
|
||||
mkdir -p /etc/supervisor/conf.d/
|
||||
|
||||
if [ -e /usr/share/sonic/platform/pmon_daemon_control.json ];
|
||||
then
|
||||
sonic-cfggen -j /usr/share/sonic/platform/pmon_daemon_control.json -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
|
||||
sonic-cfggen -j /usr/share/sonic/platform/pmon_daemon_control.json -t /usr/share/sonic/templates/start.sh.j2 > /usr/bin/start.sh
|
||||
chmod +x /usr/bin/start.sh
|
||||
else
|
||||
sonic-cfggen -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
|
||||
sonic-cfggen -t /usr/share/sonic/templates/start.sh.j2 > /usr/bin/start.sh
|
||||
chmod +x /usr/bin/start.sh
|
||||
fi
|
||||
|
||||
exec /usr/bin/supervisord
|
||||
|
6
dockers/docker-platform-monitor/start.sh → dockers/docker-platform-monitor/start.sh.j2
Executable file → Normal file
6
dockers/docker-platform-monitor/start.sh → dockers/docker-platform-monitor/start.sh.j2
Executable file → Normal file
@ -37,8 +37,14 @@ if [ -e /usr/share/sonic/platform/fancontrol ]; then
|
||||
supervisorctl start fancontrol
|
||||
fi
|
||||
|
||||
{% if not skip_ledd %}
|
||||
supervisorctl start ledd
|
||||
{% endif %}
|
||||
|
||||
{% if not skip_xcvrd %}
|
||||
supervisorctl start xcvrd
|
||||
{% endif %}
|
||||
|
||||
{% if not skip_psud %}
|
||||
supervisorctl start psud
|
||||
{% endif %}
|
Loading…
Reference in New Issue
Block a user