aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-08-17 13:38:28 +0000
committerGerrit Code Review <review@openstack.org>2017-08-17 13:38:28 +0000
commite8c24f9a379e4cf16fbc7affb7af176ea2bc7f66 (patch)
tree2c89f14b90db501e92b658bc17f9e5d6a4bdc0e7 /templates
parentc82a5fe7e0d6347b317505b2dd49d8b1d3fa8163 (diff)
parent70987c80c1212e0ad50c4a7600cbf1665f673cc2 (diff)
Merge "Add logrotate-crond configuration"
Diffstat (limited to 'templates')
-rw-r--r--templates/logrotate/containers_logrotate.conf.erb14
1 files changed, 14 insertions, 0 deletions
diff --git a/templates/logrotate/containers_logrotate.conf.erb b/templates/logrotate/containers_logrotate.conf.erb
new file mode 100644
index 0000000..cbf17b4
--- /dev/null
+++ b/templates/logrotate/containers_logrotate.conf.erb
@@ -0,0 +1,14 @@
+/var/log/containers/*/*.log {
+ rotate <%= @rotate %>
+ size <%= @size %>
+ missingok
+ notifempty
+<%- if @delaycompress %>
+ delaycompress
+<%- end %>
+ postrotate
+ /sbin/lsof -nPs +L1 +D /var/log 2>&1|\
+ /bin/perl -ne '/\S+\s+(\d+).*\/var\/log\/.*\(deleted\)/ && print "$1\n"' |\
+ /bin/xargs -n1 -r -t kill -HUP
+ endscript
+}