From a10438f6c429be3c23ee28d6609d9204a8781a9d Mon Sep 17 00:00:00 2001 From: Don Penney Date: Wed, 17 Jul 2019 11:47:18 -0400 Subject: [PATCH] Fix barbican-api.log rotation issue The barbican-api process currently writes directly to its logfile. As such, the logrotate config file needs a copytruncate directive to ensure the process doesn't end up writing to the rotated file instead. Change-Id: I60c8a08ce612fd7f82e05f69b168919b12ab0017 Partial-Bug: 1836632 Signed-off-by: Don Penney --- puppet-manifests/centos/build_srpm.data | 2 +- .../src/modules/openstack/manifests/barbican.pp | 5 +++++ .../openstack/templates/barbican-api-logrotate.erb | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 puppet-manifests/src/modules/openstack/templates/barbican-api-logrotate.erb diff --git a/puppet-manifests/centos/build_srpm.data b/puppet-manifests/centos/build_srpm.data index 0fe7d7a4e4..9eec371b56 100644 --- a/puppet-manifests/centos/build_srpm.data +++ b/puppet-manifests/centos/build_srpm.data @@ -1,2 +1,2 @@ SRC_DIR="src" -TIS_PATCH_VER=90 +TIS_PATCH_VER=91 diff --git a/puppet-manifests/src/modules/openstack/manifests/barbican.pp b/puppet-manifests/src/modules/openstack/manifests/barbican.pp index b7fb1d7d47..dd5d7e752c 100644 --- a/puppet-manifests/src/modules/openstack/manifests/barbican.pp +++ b/puppet-manifests/src/modules/openstack/manifests/barbican.pp @@ -40,6 +40,11 @@ class openstack::barbican match => '.*workers = .*', tag => 'modify-workers', } + + file { '/etc/logrotate.d/barbican-api': + ensure => present, + content => template('openstack/barbican-api-logrotate.erb') + } } } diff --git a/puppet-manifests/src/modules/openstack/templates/barbican-api-logrotate.erb b/puppet-manifests/src/modules/openstack/templates/barbican-api-logrotate.erb new file mode 100644 index 0000000000..ed53ec5c76 --- /dev/null +++ b/puppet-manifests/src/modules/openstack/templates/barbican-api-logrotate.erb @@ -0,0 +1,14 @@ +# This file is managed by Puppet. +# +# logrotate.d configuration +# Used in rpm build. Keep in sync with debian/barbican-api.logrotate +/var/log/barbican/barbican-api.log { + nodateext + size 10M + start 1 + rotate 20 + missingok + compress + notifempty + copytruncate +}