Hi, seeems after move to new location /var/log/pihole/pihole.log logrotation is not working anymore, pihole.log is growing and will fill up my fs.
Did I miss anything after last update? There is no pihole file in /etc/logrotate.d anymore ...
Maybe permissions, there was also as logrotate sec fix in Debian 11.4
there never has been one, logrotate settings for the pihole logs are in /etc/pihole/logrotate
a cron job executes the logrotate (/etc/cron.d/pihole), specific lines:
# Pi-hole: Flush the log daily at 00:00
# The flush script will use logrotate if available
# parameter "once": logrotate only once (default is twice)
# parameter "quiet": don't print messages
00 00 * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole flush once quiet
@reboot root /usr/sbin/logrotate --state /var/lib/logrotate/pihole /etc/pihole/logrotate
you can manually flush the log, using pihole -f
, this will execute /opt/pihole/piholeLogFlush.sh (same as the cron job does).
no
what are the permissions on /var/lib/logrotate/pihole?
640 root root for /var/lib/lorotate/pihole
just checked the repository (here). paths are correct.
run pihole -r
to update everything, while keeping your settings
Nope, in repo pihole Dir is in in mine not
what version are you running? should be
pihole -v
Pi-hole version is v5.11.3 (Latest: v5.11.3)
AdminLTE version is v5.13 (Latest: v5.13)
FTL version is v5.16.1 (Latest: v5.16.1)
Same for me
check content of /etc/.pihole/advanced/Templates/logrotate
, should match the content of the repository.
edit
if there is a mismatch, there are probably other problems.
old solution here
OR
submit a debuglog (pihole -d) and wait for the moderators to respond...
/edit
At least for me, on my system, I had found that /etc/pihole/logrotate
did not match /etc/.pihole/advanced/Templates/logrotate
. Once I replaced with the new version, containing the correct paths, it seems to be working.
Indeed, it seems your /etc/pihole/logrotate
hasn't been adjusted for the changed log file locations during update.
Since users may choose to customise their log file locations, the update script makes an effort to detect and keep any user applied changes. It seems this didn't work as expected here, and the file was kept as it was.
We are already aware of this and keep track of it in Fix broken logrotate config by updating old paths in existing file if they exist by PromoFaux · Pull Request #4810 · pi-hole/pi-hole · GitHub.
If you didn't touch log file locations yourself, it should be enough to simply copy the template to Pi-hole's configuration, e.g. by
sudo cp /etc/.pihole/advanced/Templates/logrotate /etc/pihole/logrotate
Thx @Bucking_Horn @yubiuser , any reason why the std Was not updated?