Skip to content

Commit 2bbcd68

Browse files
author
Dean Troyer
committed
Add SERVICE_TIMEOUT
1 parent 49946a1 commit 2bbcd68

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

stack.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ if [ ! -n "$HOST_IP" ]; then
175175
HOST_IP=`LC_ALL=C /sbin/ifconfig | grep -m 1 'inet addr:'| cut -d: -f2 | awk '{print $1}'`
176176
fi
177177

178+
# Service startup timeout
179+
SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60}
180+
178181
# Generic helper to configure passwords
179182
function read_password {
180183
set +o xtrace
@@ -926,7 +929,7 @@ fi
926929
if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
927930
screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf"
928931
echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..."
929-
if ! timeout 60 sh -c "while ! wget -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then
932+
if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then
930933
echo "g-api did not start"
931934
exit 1
932935
fi
@@ -936,7 +939,7 @@ fi
936939
if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
937940
screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_CONF -d"
938941
echo "Waiting for keystone to start..."
939-
if ! timeout 60 sh -c "while ! wget -q -O- http://127.0.0.1:5000; do sleep 1; done"; then
942+
if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget -q -O- http://127.0.0.1:5000; do sleep 1; done"; then
940943
echo "keystone did not start"
941944
exit 1
942945
fi
@@ -946,7 +949,7 @@ fi
946949
if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
947950
screen_it n-api "cd $NOVA_DIR && $NOVA_DIR/bin/nova-api"
948951
echo "Waiting for nova-api to start..."
949-
if ! timeout 60 sh -c "while ! wget -q -O- http://127.0.0.1:8774; do sleep 1; done"; then
952+
if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget -q -O- http://127.0.0.1:8774; do sleep 1; done"; then
950953
echo "nova-api did not start"
951954
exit 1
952955
fi

0 commit comments

Comments
 (0)