Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

CPU/IO intensive logrotation due to `copytruncate` #2

dim opened this Issue Apr 8, 2013 · 1 comment


None yet
2 participants

dim commented Apr 8, 2013

Nginx supports USR1 for reopening logs, here's what my (IO friendly) logrotate snippet looks like (postrotate is taken from Debian package):

logrotate_app 'openresty' do
  path "#{node['openresty']['log_dir']}/*.log"
  enable true
  frequency 'daily'
  rotate 7
  cookbook 'logrotate'
  create "0644 #{node['openresty']['user']} adm"
  options [ 'missingok', 'delaycompress', 'notifempty', 'compress', 'sharedscripts' ]
  postrotate "[ ! -f #{node['openresty']['pid']} ] || kill -USR1 `cat #{node['openresty']['pid']}`"

priestjim commented Apr 8, 2013

Thanks for the feedback! I implemented it, expect it in the next cookbook release!

@priestjim priestjim closed this Apr 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment