Skip to content

Commit

Permalink
Ensure rsyslog is running in build environments
Browse files Browse the repository at this point in the history
  • Loading branch information
hartmantis committed Feb 2, 2016
1 parent b5dd522 commit fb81366
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test/cookbooks/clamav_test/recipes/default.rb
Expand Up @@ -21,4 +21,32 @@
# Compiler is needed to install Cucumber for the acceptance tests
include_recipe 'apt' if node['platform_family'] == 'debian'
include_recipe 'build-essential'
include_recipe 'clamav::default'

# Ensure rsyslog is installed and running, regardless of whether the build
# environment is a Vagrant box or a Docker container with no init system.
package 'rsyslog'
file '/etc/rsyslog.conf' do
content <<-EOH.gsub(/^ {4}/, '')
$ModLoad imuxsock
$WorkDirectory /var/lib/rsyslog
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$OmitLocalLogging off
*.info;mail.none;authpriv.none;cron.none /var/log/messages
authpriv.* /var/log/secure
mail.* -/var/log/maillog
cron.* /var/log/cron
*.emerg :omusrmsg:*
uucp,news.crit /var/log/spooler
local7.* /var/log/boot.log
EOH
only_if do
node['platform_family'] == 'rhel' && \
node['platform_version'].to_i >= 7 && \
File.open('/proc/1/cmdline').read.start_with?('/usr/sbin/sshd')
end
end
execute 'rsyslogd' do
ignore_failure true
end

include_recipe 'clamav'

0 comments on commit fb81366

Please sign in to comment.