Browse code

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

Anthony Young authored on 2011/09/21 01:59:54
Showing 3 changed files
... ...
@@ -24,7 +24,7 @@ registry_port = 9191
24 24
 
25 25
 # Log to this file. Make sure you do not set the same log
26 26
 # file for both the API and registry servers!
27
-log_file = /var/log/glance/api.log
27
+log_file = %DEST%/glance/api.log
28 28
 
29 29
 # Send logs to syslog (/dev/log) instead of to file specified by `log_file`
30 30
 use_syslog = False
... ...
@@ -3,7 +3,7 @@
3 3
 verbose = True
4 4
 
5 5
 # Show debugging output in logs (sets DEBUG log level output)
6
-debug = False
6
+debug = True
7 7
 
8 8
 # Address to bind the registry server
9 9
 bind_host = 0.0.0.0
... ...
@@ -13,7 +13,10 @@ bind_port = 9191
13 13
 
14 14
 # Log to this file. Make sure you do not set the same log
15 15
 # file for both the API and registry servers!
16
-log_file = /var/log/glance/registry.log
16
+log_file = %DEST%/glance/registry.log
17
+
18
+# Where to store images
19
+filesystem_store_datadir %DEST%/glance/images
17 20
 
18 21
 # Send logs to syslog (/dev/log) instead of to file specified by `log_file`
19 22
 use_syslog = False
... ...
@@ -267,15 +267,13 @@ fi
267 267
 # ------
268 268
 
269 269
 if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
270
-    # Glance uses ``/var/lib/glance`` and ``/var/log/glance`` by default, so
271
-    # we need to insure that our user has permissions to use them.
272
-    sudo mkdir -p /var/log/glance
273
-    sudo chown -R `whoami` /var/log/glance 
274
-    sudo mkdir -p /var/lib/glance
275
-    sudo chown -R `whoami` /var/lib/glance
276
-
277
-    # Delete existing images/database as glance will recreate the db on startup
278
-    rm -rf /var/lib/glance/images/*
270
+    GLANCE_IMAGE_DIR= $DEST/glance/images
271
+    # Delete existing images
272
+    rm -rf $GLANCE_IMAGE_DIR
273
+
274
+    # Use local glance directories
275
+    mkdir -p $GLANCE_IMAGE_DIR
276
+
279 277
     # (re)create glance database
280 278
     mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'DROP DATABASE glance;' || true
281 279
     mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE glance;'
... ...
@@ -283,9 +281,11 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
283 283
     GLANCE_CONF=$GLANCE_DIR/etc/glance-registry.conf
284 284
     cp $FILES/glance-registry.conf $GLANCE_CONF
285 285
     sudo sed -e "s,%SQL_CONN%,$BASE_SQL_CONN/glance,g" -i $GLANCE_CONF
286
+    sudo sed -e "s,%DEST%,$DEST,g" -i $GLANCE_CONF
286 287
 
287 288
     GLANCE_API_CONF=$GLANCE_DIR/etc/glance-api.conf
288 289
     cp $FILES/glance-api.conf $GLANCE_API_CONF
290
+    sudo sed -e "s,%DEST%,$DEST,g" -i $GLANCE_API_CONF
289 291
 fi
290 292
 
291 293
 # Nova