fixes to glance configuration so that we aren't creating files outside of /opt

This commit is contained in:
Anthony Young 2011-09-20 09:59:54 -07:00
parent 9bf3d767ce
commit a531b77267
3 changed files with 14 additions and 11 deletions

View file

@ -24,7 +24,7 @@ registry_port = 9191
# Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = /var/log/glance/api.log
log_file = %DEST%/glance/api.log
# Send logs to syslog (/dev/log) instead of to file specified by `log_file`
use_syslog = False

View file

@ -3,7 +3,7 @@
verbose = True
# Show debugging output in logs (sets DEBUG log level output)
debug = False
debug = True
# Address to bind the registry server
bind_host = 0.0.0.0
@ -13,7 +13,10 @@ bind_port = 9191
# Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = /var/log/glance/registry.log
log_file = %DEST%/glance/registry.log
# Where to store images
filesystem_store_datadir %DEST%/glance/images
# Send logs to syslog (/dev/log) instead of to file specified by `log_file`
use_syslog = False

View file

@ -267,15 +267,13 @@ fi
# ------
if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
# Glance uses ``/var/lib/glance`` and ``/var/log/glance`` by default, so
# we need to insure that our user has permissions to use them.
sudo mkdir -p /var/log/glance
sudo chown -R `whoami` /var/log/glance
sudo mkdir -p /var/lib/glance
sudo chown -R `whoami` /var/lib/glance
GLANCE_IMAGE_DIR= $DEST/glance/images
# Delete existing images
rm -rf $GLANCE_IMAGE_DIR
# Use local glance directories
mkdir -p $GLANCE_IMAGE_DIR
# Delete existing images/database as glance will recreate the db on startup
rm -rf /var/lib/glance/images/*
# (re)create glance database
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE glance;' || true
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE glance;'
@ -283,9 +281,11 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
GLANCE_CONF=$GLANCE_DIR/etc/glance-registry.conf
cp $FILES/glance-registry.conf $GLANCE_CONF
sudo sed -e "s,%SQL_CONN%,$BASE_SQL_CONN/glance,g" -i $GLANCE_CONF
sudo sed -e "s,%DEST%,$DEST,g" -i $GLANCE_CONF
GLANCE_API_CONF=$GLANCE_DIR/etc/glance-api.conf
cp $FILES/glance-api.conf $GLANCE_API_CONF
sudo sed -e "s,%DEST%,$DEST,g" -i $GLANCE_API_CONF
fi
# Nova