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 # Log to this file. Make sure you do not set the same log
# file for both the API and registry servers! # 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` # Send logs to syslog (/dev/log) instead of to file specified by `log_file`
use_syslog = False use_syslog = False

View file

@ -3,7 +3,7 @@
verbose = True verbose = True
# Show debugging output in logs (sets DEBUG log level output) # Show debugging output in logs (sets DEBUG log level output)
debug = False debug = True
# Address to bind the registry server # Address to bind the registry server
bind_host = 0.0.0.0 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 # Log to this file. Make sure you do not set the same log
# file for both the API and registry servers! # 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` # Send logs to syslog (/dev/log) instead of to file specified by `log_file`
use_syslog = False use_syslog = False

View file

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