openvswitch: wait for ovs socket readiness

Add a check (with a timeout) to wait for the openvswitch socket to
prevent erronious crashes on inital startup.

Change-Id: I000425a439f320974904129b65b7840702693ab4
This commit is contained in:
Chris Wedgwood 2017-10-13 22:28:12 +00:00
parent 609ce478f5
commit 2715620d17

View File

@ -24,6 +24,18 @@ modprobe openvswitch
modprobe gre
modprobe vxlan
sock="/var/run/openvswitch/db.sock"
t=0
while [ ! -e "${sock}" ] ; do
echo "waiting for ovs socket $sock"
sleep 1
t=$(($t+1))
if [ $t -ge 10 ] ; then
echo "no ovs socket, giving up"
exit 1
fi
done
ovs-vsctl --no-wait show
external_bridge="{{- .Values.network.external_bridge -}}"