mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-04 20:29:27 +01:00
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:
parent
85fc31ec7f
commit
42c078422c
@ -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" \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user