Browse code

Do not modify rsyslog files if rsyslog is not used.

Swift was missing an 'if [[ $SYSLOG != "False" ]]' statement which is used
by other services, and therefor failed with a 'No such file or directory'
error when 'SYSLOG=False' was set in localrc.

Closes-Bug: 1308461

Change-Id: I8655a955ebb322516d92bee418b93d4cc23bdc5c

Yves-Gwenael Bourhis authored on 2014/04/16 20:37:46
Showing 1 changed files
... ...
@@ -453,10 +453,13 @@ EOF
453 453
     rm -rf ${swift_log_dir}
454 454
     mkdir -p ${swift_log_dir}/hourly
455 455
     sudo chown -R ${STACK_USER}:adm ${swift_log_dir}
456
-    sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
457
-        tee /etc/rsyslog.d/10-swift.conf
458
-    # restart syslog to take the changes
459
-    sudo killall -HUP rsyslogd
456
+
457
+    if [[ $SYSLOG != "False" ]]; then
458
+        sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
459
+            tee /etc/rsyslog.d/10-swift.conf
460
+        # restart syslog to take the changes
461
+        sudo killall -HUP rsyslogd
462
+    fi
460 463
 
461 464
     if is_apache_enabled_service swift; then
462 465
         _config_swift_apache_wsgi