Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dockers/docker-fpm-frr/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ COPY ["TSB", "/usr/bin/TSB"]
COPY ["TSC", "/usr/bin/TSC"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]
COPY ["bgpd.sh", "/usr/bin/"]
RUN chmod a+x /usr/bin/TSA && \
chmod a+x /usr/bin/TSB && \
chmod a+x /usr/bin/TSC
Expand Down
33 changes: 33 additions & 0 deletions dockers/docker-fpm-frr/bgpd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

addr="127.0.0.1"
port=2601

function help()
{
echo "This script aims to ensure zebra is ready to accept connections before starting bgpd"
echo "Usage: $0 [options] [bgpd options]"
echo "Options:"
echo " -a Zebra address"
echo " -o Zebra port"
exit 1
}

while getopts ":a:o:h" opt; do
case "${opt}" in
h) help
;;
a) addr=${OPTARG}
;;
o) port=${OPTARG}
;;
esac
done
shift $((OPTIND-1))

timeout 5s bash -c -- "until </dev/tcp/${addr}/${port}; do sleep 0.1;done"
if [ "$?" != "0" ]; then
logger "Error: zebra is not ready to accept connections"
fi

exec /usr/lib/frr/bgpd "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependent_startup=true
dependent_startup_wait_for=zebra:running

[program:bgpd]
command=/usr/lib/frr/bgpd -A 127.0.0.1 -M snmp
command=/usr/bin/bgpd.sh -A 127.0.0.1 -M snmp
priority=5
stopsignal=KILL
autostart=false
Expand Down