Browse code

Merge pull request #104 from jeblair/master

Add syslog option

Jesse Andrews authored on 2011/10/28 04:42:37
Showing 3 changed files
... ...
@@ -27,7 +27,7 @@ registry_port = 9191
27 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
-use_syslog = False
30
+use_syslog = %SYSLOG%
31 31
 
32 32
 # ============ Notification System Options =====================
33 33
 
... ...
@@ -19,7 +19,7 @@ log_file = %DEST%/glance/registry.log
19 19
 filesystem_store_datadir = %DEST%/glance/images
20 20
 
21 21
 # Send logs to syslog (/dev/log) instead of to file specified by `log_file`
22
-use_syslog = False
22
+use_syslog = %SYSLOG%
23 23
 
24 24
 # SQLAlchemy connection string for the reference implementation
25 25
 # registry server. Any valid SQLAlchemy connection string is fine.
... ...
@@ -78,6 +78,9 @@ source ./stackrc
78 78
 # Destination path for installation ``DEST``
79 79
 DEST=${DEST:-/opt/stack}
80 80
 
81
+# Configure services to syslog instead of writing to individual log files
82
+SYSLOG=${SYSLOG:-False}
83
+
81 84
 # OpenStack is designed to be run as a regular user (Dashboard will fail to run
82 85
 # as root, since apache refused to startup serve content from root user).  If
83 86
 # stack.sh is run as root, it automatically creates a stack user with
... ...
@@ -478,11 +481,13 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
478 478
     sudo sed -e "s,%SQL_CONN%,$BASE_SQL_CONN/glance,g" -i $GLANCE_CONF
479 479
     sudo sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" -i $GLANCE_CONF
480 480
     sudo sed -e "s,%DEST%,$DEST,g" -i $GLANCE_CONF
481
+    sudo sed -e "s,%SYSLOG%,$SYSLOG,g" -i $GLANCE_CONF
481 482
 
482 483
     GLANCE_API_CONF=$GLANCE_DIR/etc/glance-api.conf
483 484
     cp $FILES/glance-api.conf $GLANCE_API_CONF
484 485
     sudo sed -e "s,%DEST%,$DEST,g" -i $GLANCE_API_CONF
485 486
     sudo sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" -i $GLANCE_API_CONF
487
+    sudo sed -e "s,%SYSLOG%,$SYSLOG,g" -i $GLANCE_API_CONF
486 488
 fi
487 489
 
488 490
 # Nova
... ...
@@ -627,6 +632,9 @@ if [ -n "$MULTI_HOST" ]; then
627 627
     add_nova_flag "--multi_host=$MULTI_HOST"
628 628
     add_nova_flag "--send_arp_for_ha=1"
629 629
 fi
630
+if [ "$SYSLOG" != "False" ]; then
631
+    add_nova_flag "--use_syslog=1"
632
+fi
630 633
 
631 634
 # Nova Database
632 635
 # ~~~~~~~~~~~~~