ubuntu: Fix the wait_for_network method in the agent init script.

The init script was waiting for cloudbr0 to come up, but it's not mandatory that this bridge is available.

We now wait for at least one bridge to be up before starting the cloud agent.
This commit is contained in:
Wido den Hollander 2012-06-21 12:20:04 +02:00
parent 85fc31ec7f
commit 42c078422c

View File

@ -50,7 +50,9 @@ wait_for_network() {
i=1 i=1
while [ $i -lt 10 ] while [ $i -lt 10 ]
do do
if ip addr show cloudbr0 |grep -w inet > /dev/null 2>&1; then # Under Ubuntu and Debian libvirt by default creates a bridge called virbr0.
# That's why we want more then 3 lines back from brctl, so that there is a manually created bridge
if [ "$(brctl show|wc -l)" -gt 2 ]; then
break break
else else
sleep 1 sleep 1
@ -74,9 +76,8 @@ start() {
log_end_msg 1 log_end_msg 1
exit 1 exit 1
fi fi
#FIXME: wait for network wait_for_network
wait_for_network
if start-stop-daemon --start --quiet \ if start-stop-daemon --start --quiet \
--pidfile "$PIDFILE" \ --pidfile "$PIDFILE" \