DOMjudge / domjudge-packaging

DOMjudge packaging for (Linux) distributions and live image
31 stars 37 forks source link

Logrotate is incomplete #69

Closed wgevaert closed 3 years ago

wgevaert commented 3 years ago

Today we found out that our server was full of domjudge-logs.

The problem is that the logs /var/log/domjudge/*.log are nicely rotated, but the logs in /var/log/domjudge/judgehosts/*.log (and /var/log/domjudge/domserver, which was not that full, and logrotate did not like it as we had it with owner root and group writeable by group www-data. I do not know what the correct permissions should be but this is irrelevant to the issue.) are ignored.

It would nicely be solved if debian/docker-common.logrotate is changed to something like this:

/var/log/domjudge/*.log /var/log/domjudge/*/*.log {
        weekly
        missingok
        rotate 6
        compress
        delaycompress
        notifempty
}

I am not sure about some things such as if we rather explicitly want domjudge/judgehosts/*.log or the generic domjudge/*/*.log, I think the latter is probably more future-proof.

I also do not know why our permissions of /var/log/domjudge/domserver were weird, but that has probably been a hotfix during one of our events.

thijskh commented 3 years ago

Thanks for the report and great that you've added a PR right away. You are surely correct about the lack of logrotation for those dirs, we must add that. The permissions you have for /var/log/domjudge/domserver are correct though, they are needed because both the webserver and other scripts must be able to write there. So we need to have a logrotate that can deal with it. Probably a good way forward is indeed to split it up between domserver and judgehost and add the right logrotate snippet for each.

wgevaert commented 3 years ago

Thanks!