sonic-buildimage/dockers/docker-platform-monitor/docker_init.sh
Kebo Liu 84b46bb0e0 [Pmon] dynamically load pmon daemons (#2654)
* dynamically load pmon daemons
2019-03-22 02:49:35 -07:00

19 lines
789 B
Bash
Executable File

#!/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