copr-be: fix logrotate

Let's not reload-and-restart lighttpd (two actions for two scripts), and
use the sharedscripts option.

While on it, this reverts an old hack 4c4b63516d that
might not be needed nowadays.

Fixes: https://pagure.io/copr/copr/issue/2001
Relates: https://pagure.io/fedora-infrastructure/issue/10391
This commit is contained in:
Pavel Raiskup 2021-12-03 14:55:08 +01:00
parent ddfac2e066
commit d05a9558f8

View file

@ -1,9 +1,15 @@
/var/log/lighttpd/access.log {
# We don't want to reload lighttpd twice (for each log file), so we use
# the sharedscripts option. This means that hitcounter is run only once too
# (which is good). In (likely impossible) situations when access.log is empty
# and error.log not, we would call hitcounter too on an empty file.
/var/log/lighttpd/*.log {
rotate 5
daily
missingok
notifempty
compress
sharedscripts
prerotate
{% if devel %}
/usr/bin/copr_log_hitcounter.py /var/log/lighttpd/access.log --ignore-subnets 172.25.144.0/20 209.132.184.33/24 &>>/var/log/copr-backend/hitcounter-logrotate.log || :
@ -15,13 +21,3 @@
/usr/bin/killall -HUP lighttpd &>/dev/null || :
endscript
}
/var/log/lighttpd/error.log {
rotate 5
missingok
notifempty
compress
postrotate
systemctl restart lighttpd.service &>/dev/null || :
endscript
}