fixes to glance configuration so that we aren't creating files outside of /opt
diff --git a/files/glance-api.conf b/files/glance-api.conf
index ac2ee94..a2edde8 100644
--- a/files/glance-api.conf
+++ b/files/glance-api.conf
@@ -24,7 +24,7 @@
# 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
diff --git a/files/glance-registry.conf b/files/glance-registry.conf
index 20a29cd..fc20988 100644
--- a/files/glance-registry.conf
+++ b/files/glance-registry.conf
@@ -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 @@
# 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
diff --git a/stack.sh b/stack.sh
index 39e026f..d3b1c52 100755
--- a/stack.sh
+++ b/stack.sh
@@ -267,15 +267,13 @@
# ------
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
- # Delete existing images/database as glance will recreate the db on startup
- rm -rf /var/lib/glance/images/*
+ # Use local glance directories
+ mkdir -p $GLANCE_IMAGE_DIR
+
# (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 @@
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