Skip to content

Commit df629c3

Browse files
author
shi-su
committed
add log for time spent for waiting for zebra
1 parent 6e96396 commit df629c3

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

dockers/docker-fpm-frr/Dockerfile.j2

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,7 @@ COPY ["TSA", "/usr/bin/TSA"]
5454
COPY ["TSB", "/usr/bin/TSB"]
5555
COPY ["TSC", "/usr/bin/TSC"]
5656
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
57-
<<<<<<< HEAD
58-
COPY ["bgpd.sh", "/usr/bin/"]
59-
=======
60-
COPY ["critical_processes", "/etc/supervisor"]
6157
COPY ["zsocket.sh", "/usr/bin/"]
62-
>>>>>>> make a separate script to wait zebra to be ready to receive connections
6358
RUN chmod a+x /usr/bin/TSA && \
6459
chmod a+x /usr/bin/TSB && \
6560
chmod a+x /usr/bin/TSC && \

dockers/docker-fpm-frr/zsocket.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ while getopts ":a:o:h" opt; do
2424
esac
2525
done
2626

27+
start=$(date +%s.%N)
2728
timeout 5s bash -c -- "until </dev/tcp/${addr}/${port}; do sleep 0.1;done"
2829
if [ "$?" != "0" ]; then
2930
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"
3034
fi
3135

3236
exit 0

0 commit comments

Comments
 (0)