Fix /var/log permissions for logging on Ubuntu

With the move of /var/log to a mount point as part of
I65c1c2f627a0124ed1f2d09d82df397012fe87f3, the folder permissions were
lost so rsyslog could not create some log files. This change ensures the
/var/log folder is owned by root:syslog with mode 0775 which are the
defaults for Ubuntu.

Change-Id: If7a7ec2a86f2d06e23c77b61bdf2ccd772ce3e5e
Closes-Bug: 1489347
This commit is contained in:
Alex Schultz 2015-08-27 16:49:26 -05:00
parent 800b28137e
commit c6ea464cdb
2 changed files with 23 additions and 0 deletions

View File

@ -28,6 +28,16 @@ if ($syslog_hash['syslog_server'] != ''
}
if $use_syslog {
if ($::operatingsystem == 'Ubuntu') {
# ensure the var log folder permissions are correct even if it's a mount
# LP#1489347
file { '/var/log':
owner => 'root',
group => 'syslog',
mode => '0775',
}
}
class { '::openstack::logging':
role => 'client',
show_timezone => true,

View File

@ -3,6 +3,19 @@ require 'shared-examples'
manifest = 'logging/logging.pp'
describe manifest do
shared_examples 'catalog' do
it {
if facts[:operatingsystem] == 'Ubuntu'
should contain_file('/var/log').with(
'owner' => 'root',
'group' => 'syslog',
'mode' => '0775'
)
else
should_not contain_file('/var/log')
end
}
end
test_ubuntu_and_centos manifest
end