Merge "Install nova-api from github."

This commit is contained in:
Jenkins 2013-01-20 22:50:51 +00:00 committed by Gerrit Code Review
commit b4e495f6ef
3 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,2 @@
Installs Nova API service from github.

View file

@ -0,0 +1,39 @@
#!/bin/sh
set -eux
useradd -G admin -m nova -s /bin/false
DEBIAN_FRONTEND=noninteractive apt-get -y install \
python-pip git-core python-setuptools python-dev python-lxml python-netaddr \
python-pastescript python-pastedeploy python-paste python-sqlalchemy \
python-greenlet python-routes python-simplejson python-webob rabbitmq-server
OS_ROOT=/opt/stack
mkdir -p $OS_ROOT
# clone source
NOVA_ROOT=$OS_ROOT/nova
git clone https://github.com/openstack/nova.git $NOVA_ROOT
cd $NOVA_ROOT
git checkout master
# pip dependencies
python setup.py egg_info
pip install -r nova.egg-info/requires.txt
cd -
SYS_DIRS="/etc/nova /var/log/nova $NOVA_ROOT/keys"
for d in $SYS_DIRS; do
mkdir -p $d
chown nova:nova $d
done
# config
cp $NOVA_ROOT/etc/nova/nova.conf.sample /etc/nova/nova.conf
cp $NOVA_ROOT/etc/nova/logging_sample.conf /etc/nova/logging.conf
cp $NOVA_ROOT/etc/nova/api-paste.ini /etc/nova
cp $NOVA_ROOT/etc/nova/policy.json /etc/nova
# upstart script
cp -f $(dirname $0)/../upstart/nova-api.conf /etc/init

View file

@ -0,0 +1,30 @@
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