mirror of
https://github.com/pi-hole/pi-hole.git
synced 2026-08-27 04:05:42 +00:00
If the system's /etc/logrotate.conf has dateext enabled (the upstream default, carried by most distros), our stanzas would inherit it when the system's scheduled logrotate reads them via that file - but our own forced runs invoke /etc/logrotate.d/pihole directly, bypassing logrotate.conf entirely, so they'd still use numeric suffixes. Same config, two different rotated filenames depending on who rotated it first. Set nodateext explicitly in each of our stanzas (scoped to just our own blocks, so it can't leak into other packages' logrotate.d entries) to keep this deterministic. Numeric suffixes also match what piholeLogFlush.sh's manual flush path already assumes (it looks for logfile.1 specifically). Signed-off-by: Adam Warner <me@adamwarner.co.uk>
39 lines
705 B
Text
39 lines
705 B
Text
/var/log/pihole/pihole.log {
|
|
# su #
|
|
daily
|
|
create 640 pihole pihole
|
|
rotate 5
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
nomail
|
|
nodateext
|
|
postrotate
|
|
kill -USR2 $(cat /run/pihole-FTL.pid 2>/dev/null) 2>/dev/null || true
|
|
endscript
|
|
}
|
|
|
|
# FTL.log and webserver.log are opened and closed for each line, therefore no postrotate is needed
|
|
/var/log/pihole/FTL.log {
|
|
# su #
|
|
weekly
|
|
create 640 pihole pihole
|
|
rotate 3
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
nomail
|
|
nodateext
|
|
}
|
|
|
|
/var/log/pihole/webserver.log {
|
|
# su #
|
|
weekly
|
|
create 640 pihole pihole
|
|
rotate 3
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
nomail
|
|
nodateext
|
|
}
|