From 345f0bffdaecfb758b9affe4a87ef2f63a6be762 Mon Sep 17 00:00:00 2001 From: hou Date: Thu, 19 Sep 2019 11:11:40 -0700 Subject: [PATCH 1/4] start bgp_eoiu_mark service to populate bgp eoiu marker if configured so --- dockers/docker-fpm-frr/start.sh | 5 +++++ dockers/docker-fpm-frr/supervisord.conf | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/dockers/docker-fpm-frr/start.sh b/dockers/docker-fpm-frr/start.sh index fd092919e000..a0049780780a 100755 --- a/dockers/docker-fpm-frr/start.sh +++ b/dockers/docker-fpm-frr/start.sh @@ -31,6 +31,11 @@ rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd +# start eoiu pulling, only if configured so +if [ $(sonic-cfggen -d --print-data | grep 'bgp_eoiu' | grep -c 'true') -ge 1 ]; then + supervisorctl start bgp_eoiu_marker +fi + supervisorctl start bgpcfgd # Start Quagga processes diff --git a/dockers/docker-fpm-frr/supervisord.conf b/dockers/docker-fpm-frr/supervisord.conf index ba9f38507b80..fe0ce6eda1a4 100644 --- a/dockers/docker-fpm-frr/supervisord.conf +++ b/dockers/docker-fpm-frr/supervisord.conf @@ -75,3 +75,13 @@ autorestart=false startsecs=0 stdout_logfile=syslog stderr_logfile=syslog + +[program:bgp_eoiu_marker] +command=/usr/bin/bgp_eoiu_marker.py +priority=7 +autostart=false +autorestart=false +startsecs=0 +startretries=0 +stdout_logfile=syslog +stderr_logfile=syslog From 8c9d10e89db15af08cb25981e1c6bed82009e7aa Mon Sep 17 00:00:00 2001 From: hou Date: Tue, 5 Nov 2019 14:01:19 -0800 Subject: [PATCH 2/4] Address code review comments: check db value via "-v" option in sonic-cfggen --- dockers/docker-fpm-frr/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-fpm-frr/start.sh b/dockers/docker-fpm-frr/start.sh index a0049780780a..1156e2f07469 100755 --- a/dockers/docker-fpm-frr/start.sh +++ b/dockers/docker-fpm-frr/start.sh @@ -32,7 +32,7 @@ rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd # start eoiu pulling, only if configured so -if [ $(sonic-cfggen -d --print-data | grep 'bgp_eoiu' | grep -c 'true') -ge 1 ]; then +if [ $(sonic-cfggen -d -v 'WARM_RESTART.bgp.bgp_eoiu' | grep -c 'true') -ge 1 ]; then supervisorctl start bgp_eoiu_marker fi From c4c562bb8cf376ee5b708437f42939882a8110f4 Mon Sep 17 00:00:00 2001 From: hou Date: Wed, 6 Nov 2019 15:27:50 -0800 Subject: [PATCH 3/4] Address code review comment 2: check string against 'true' directly, instead of couting --- dockers/docker-fpm-frr/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-fpm-frr/start.sh b/dockers/docker-fpm-frr/start.sh index 7a362de1a1e2..15b06793acf5 100755 --- a/dockers/docker-fpm-frr/start.sh +++ b/dockers/docker-fpm-frr/start.sh @@ -34,7 +34,7 @@ rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd # start eoiu pulling, only if configured so -if [ $(sonic-cfggen -d -v 'WARM_RESTART.bgp.bgp_eoiu' | grep -c 'true') -ge 1 ]; then +if [ $(sonic-cfggen -d -v 'WARM_RESTART.bgp.bgp_eoiu') == 'true' ]; then supervisorctl start bgp_eoiu_marker fi From e1da98eee10f140866fc3b3c3f3fb00eabd9fe9e Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Wed, 6 Nov 2019 15:55:42 -0800 Subject: [PATCH 4/4] Update start.sh --- dockers/docker-fpm-frr/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-fpm-frr/start.sh b/dockers/docker-fpm-frr/start.sh index 15b06793acf5..834aba5b1147 100755 --- a/dockers/docker-fpm-frr/start.sh +++ b/dockers/docker-fpm-frr/start.sh @@ -34,7 +34,7 @@ rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd # start eoiu pulling, only if configured so -if [ $(sonic-cfggen -d -v 'WARM_RESTART.bgp.bgp_eoiu') == 'true' ]; then +if [[ $(sonic-cfggen -d -v 'WARM_RESTART.bgp.bgp_eoiu') == 'true' ]]; then supervisorctl start bgp_eoiu_marker fi