Search code examples
linuxuwsgicentos6logrotate

How do I get logrotate to obey logrotate.d/uwsgi instead of uwsgi.ini? (Centos 6)


So it seems setting the maximum log rotate size only works when it's set in uwsgi.ini and not /etc/logrotate.d/uwsgi (even though manually testing logrotate using /etc/logrotate.d/uwsgi file works, and I see no errors in the cron or logrotate status logs).

/var/log/uwsgi/*.log {
daily
missingok
dateext
rotate 7
size 100M
copytruncate
create
compress
}

Is there a setting that makes logrotate use the above instead of uwsgi.ini?


Solution

  • The cause of the issue stemmed from SELinux security contexts, where the log directory that was being included in the original logrotate config didn't have the right security permissions. So when I kept doing ls -al, I couldn't find anything wrong because it did not show the SELInux security settings for each directory/file. I had to do ls -Z or something to that effect.