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:
parent
ddfac2e066
commit
d05a9558f8
1 changed files with 7 additions and 11 deletions
|
@ -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
|
rotate 5
|
||||||
daily
|
daily
|
||||||
missingok
|
missingok
|
||||||
notifempty
|
notifempty
|
||||||
compress
|
compress
|
||||||
|
sharedscripts
|
||||||
prerotate
|
prerotate
|
||||||
{% if devel %}
|
{% 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 || :
|
/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 || :
|
/usr/bin/killall -HUP lighttpd &>/dev/null || :
|
||||||
endscript
|
endscript
|
||||||
}
|
}
|
||||||
|
|
||||||
/var/log/lighttpd/error.log {
|
|
||||||
rotate 5
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
compress
|
|
||||||
postrotate
|
|
||||||
systemctl restart lighttpd.service &>/dev/null || :
|
|
||||||
endscript
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue