diskimage-builder/elements/nova-api/upstart/nova-api.conf

31 lines
650 B
Plaintext
Raw Normal View History

description "OpenStack Nova API Service"
start on runlevel [2345]
stop on runlevel [016]
setuid nova
setgid nova
respawn
exec /opt/stack/nova/bin/nova-api
# wait until service is running.
post-start script
svc_port=$(grep ^osapi_compute_listen_port /etc/nova/nova.conf ||:)
svc_port=${svc_port##*=}
if [ -z "$svc_port" ] ; then
svc_port="8774"
fi
for try in $(seq 9 -1 1); do
if nc -w 1 localhost $svc_port < /dev/null ; then
echo Connected to port $svc_port!
exit 0
fi
echo Could not connect to $svc_port, retrying $try more times...
sleep 1
done
end script