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
(cherry picked from commit f894c2ab805f9dfc0dfdd3668ccd3a83ee4eb9f2)

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