Skip to content

Commit 42c0784

Browse files
committed
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.
1 parent 85fc31e commit 42c0784

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

agent/distro/ubuntu/SYSCONFDIR/init.d/cloud-agent.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ wait_for_network() {
5050
i=1
5151
while [ $i -lt 10 ]
5252
do
53-
if ip addr show cloudbr0 |grep -w inet > /dev/null 2>&1; then
53+
# Under Ubuntu and Debian libvirt by default creates a bridge called virbr0.
54+
# That's why we want more then 3 lines back from brctl, so that there is a manually created bridge
55+
if [ "$(brctl show|wc -l)" -gt 2 ]; then
5456
break
5557
else
5658
sleep 1
@@ -74,9 +76,8 @@ start() {
7476
log_end_msg 1
7577
exit 1
7678
fi
77-
78-
#FIXME: wait for network
79-
wait_for_network
79+
80+
wait_for_network
8081

8182
if start-stop-daemon --start --quiet \
8283
--pidfile "$PIDFILE" \

0 commit comments

Comments
 (0)