CSIRO-enviro-informatics / registry-config-base

Reusable configuration files and UI templates for registry installations
Apache License 2.0
3 stars 3 forks source link

Logrotation isn't working #5

Open benjaminleighton opened 5 years ago

benjaminleighton commented 5 years ago

Log rotation isn't working correctly at least for nginx.

Multiple issues

In a local installation two changes appear to work

  1. changing /etc/logrotate.d/nginx to
    /var/log/nginx/*.log {  
        daily  
        missingok  
        rotate 52  
        compress  
        delaycompress  
        notifempty  
        copytruncate  
        sharedscripts  
        prerotate  
                if [ -d /etc/logrotate.d/httpd-prerotate ]; then \  
                        run-parts /etc/logrotate.d/httpd-prerotate; \  
                fi \  
        endscript   
        postrotate  
                invoke-rc.d nginx rotate >/dev/null 2>&1  
        endscript  
    }  

    because copytruncate bypasses issues with create

  2. chmod www-data /var/log/nginx

docker file needs to be updated with these changes, changes tested and other log rotation checked

benjaminleighton commented 5 years ago

Tested fix in locally deployed instance and merged but will wait for redeployment into prod to ensure this is working before closing this issue