File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,9 +54,10 @@ COPY ["TSA", "/usr/bin/TSA"]
5454COPY ["TSB", "/usr/bin/TSB"]
5555COPY ["TSC", "/usr/bin/TSC"]
5656COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
57- COPY ["bgpd .sh", "/usr/bin/"]
57+ COPY ["zsocket .sh", "/usr/bin/"]
5858RUN chmod a+x /usr/bin/TSA && \
5959 chmod a+x /usr/bin/TSB && \
60- chmod a+x /usr/bin/TSC
60+ chmod a+x /usr/bin/TSC && \
61+ chmod a+x /usr/bin/zsocket.sh
6162
6263ENTRYPOINT ["/usr/bin/docker_init.sh"]
Original file line number Diff line number Diff line change @@ -39,6 +39,17 @@ stderr_logfile=syslog
3939dependent_startup=true
4040dependent_startup_wait_for=rsyslogd:running
4141
42+ [program:zsocket]
43+ command=/usr/bin/zsocket.sh
44+ priority=4
45+ autostart=false
46+ autorestart=false
47+ startsecs=0
48+ stdout_logfile=syslog
49+ stderr_logfile=syslog
50+ dependent_startup=true
51+ dependent_startup_wait_for=zebra:running
52+
4253[program:staticd]
4354command=/usr/lib/frr/staticd -A 127.0.0.1
4455priority=4
@@ -48,7 +59,7 @@ startsecs=0
4859stdout_logfile=syslog
4960stderr_logfile=syslog
5061dependent_startup=true
51- dependent_startup_wait_for=zebra:running
62+ dependent_startup_wait_for=zsocket:exited
5263
5364{% if DEVICE_METADATA .localhost .frr_mgmt_framework_config is defined and DEVICE_METADATA .localhost .frr_mgmt_framework_config == "true" %}
5465[program:bfdd]
@@ -65,7 +76,7 @@ dependent_startup_wait_for=zebra:running
6576{% endif %}
6677
6778[program:bgpd]
68- command=/usr/bin/ bgpd.sh -A 127.0.0.1 -M snmp
79+ command=/usr/lib/frr/ bgpd -A 127.0.0.1 -M snmp
6980priority=5
7081stopsignal=KILL
7182autostart=false
@@ -74,7 +85,7 @@ startsecs=0
7485stdout_logfile=syslog
7586stderr_logfile=syslog
7687dependent_startup=true
77- dependent_startup_wait_for=zebra:running
88+ dependent_startup_wait_for=zsocket:exited
7889
7990{% if DEVICE_METADATA .localhost .frr_mgmt_framework_config is defined and DEVICE_METADATA .localhost .frr_mgmt_framework_config == "true" %}
8091[program:ospfd]
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ port=2601
55
66function help()
77{
8- echo " This script aims to ensure zebra is ready to accept connections before starting bgpd "
9- echo " Usage: $0 [options] [bgpd options] "
8+ echo " This script aims to ensure zebra is ready to accept connections"
9+ echo " Usage: $0 [options]"
1010 echo " Options:"
1111 echo " -a Zebra address"
1212 echo " -o Zebra port"
@@ -23,11 +23,14 @@ while getopts ":a:o:h" opt; do
2323 ;;
2424 esac
2525done
26- shift $(( OPTIND- 1 ))
2726
27+ start=$( date +%s.%N)
2828timeout 5s bash -c -- " until </dev/tcp/${addr} /${port} ; do sleep 0.1;done"
2929if [ " $? " != " 0" ]; then
3030 logger -p error " Error: zebra is not ready to accept connections"
31+ else
32+ timespan=$( awk " BEGIN {print $( date +%s.%N) -$start ; exit}" )
33+ logger -p info " It took ${timespan} seconds to wait for zebra to be ready to accept connections"
3134fi
3235
33- exec /usr/lib/frr/bgpd " $@ "
36+ exit 0
You can’t perform that action at this time.
0 commit comments