From f894c2ab805f9dfc0dfdd3668ccd3a83ee4eb9f2 Mon Sep 17 00:00:00 2001 From: Yves-Gwenael Bourhis Date: Wed, 16 Apr 2014 13:37:46 +0200 Subject: [PATCH] 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 --- lib/swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/swift b/lib/swift index 3e183ff257..6db779a58f 100644 --- a/lib/swift +++ b/lib/swift @@ -453,10 +453,13 @@ EOF rm -rf ${swift_log_dir} mkdir -p ${swift_log_dir}/hourly sudo chown -R ${STACK_USER}:adm ${swift_log_dir} - sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \ - tee /etc/rsyslog.d/10-swift.conf - # restart syslog to take the changes - sudo killall -HUP rsyslogd + + if [[ $SYSLOG != "False" ]]; then + sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \ + tee /etc/rsyslog.d/10-swift.conf + # restart syslog to take the changes + sudo killall -HUP rsyslogd + fi if is_apache_enabled_service swift; then _config_swift_apache_wsgi