summaryrefslogtreecommitdiffstats
path: root/templates/logrotate/containers_logrotate.conf.erb
diff options
context:
space:
mode:
Diffstat (limited to 'templates/logrotate/containers_logrotate.conf.erb')
-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
+}