Closed Bogdan107 closed 2 years ago
Also, I have conflict with logrotate
system service and logrotate
pihole script.
My logrotate system service started daily from /etc/cron.daily/logrotate
script (at any time).
Pihole logrotate script started daily at 00:00 from /etc/cron.d/pihole
script.
So in that configuration /var/log/pihole.log
file will be logrotated twice per day, but must be logrotated once per day.
Please, resolve this conflict.
I know about two variants:
1) comment/remove Flush the log daily at 00:00
task in /etc/cron.d/pihole
;
2) remove pihole script from system logrotate service (by moving /etc/logrotate/pihole
to /etc/pihole/logrotate
).
I think, that pihole logrotate task in /etc/cron.d/pihole is more preferenceble, as logfiles will be stronger in timestamps. I like this variant. But I use pihole in my laptop, which I start and stop at any time. And most of peoples laptop's are swithed off at 00:00 time. So, I think that pihole's logs must be logrotated by system logrotate service, not exactly at 00:00 by pihole cron file. So, variant 2 is more preferrable for personal computers (laptops).
Please, update ebuild.
I think it would be better to just have logrotate and no flushing in the crontab file. I did not realise exactly what the crontab file had in it as I do not use it. It is redundant to have both.
The logrotate config needs to have missingok
in both sections.
I just realised, Pi-hole needs an update and I didn't catch this due to a regex issue. I am going to get that with this issue fixed.
May be improve logrotate
use flag for controlling logrotate config at /etc/logrotate/pihole
path?
Something like this:
If logrotate
use flag switched on:
1) place logrotate config to /etc/logrotate.d/pihole
file;
2) patch /etc/cron.d/pihole
file to comment Flush the log daily at 00:00 task;
3) modify /etc/cron.d/pihole
file by sed -i "s$/etc/pihole/logrotate$/etc/logrotate.d/pihole$g"
.
If logrotate
use flag switched off:
1) place logrotate config to /etc/pihole/logrotate
file;
2) place /etc/cron.d/pihole
file without modifications;
If you want to change /etc
stuff that is okay and Portage will not change those files without giving confirmation (you need to use dispatch-conf
, etc). You can even mask a file away if you don't want it in make.conf
.
Therefore, to use your preferred config I suggest masking away the files and putting your own versions in place.
For the ticket title, this is resolved with: https://github.com/Tatsh/tatsh-overlay/commit/48377046dce0a19c20127d411f0a94ce17617618
I have some errors by cron: 1)
error: cannot stat /etc/pihole/logrotate: No such file or directory
Command:/usr/bin/logrotate /etc/pihole/logrotate
. Command called from/etc/cron.d/pihole
. 2)error: stat of /var/log/pihole.log failed: No such file or directory
Command:PATH="$PATH:/usr/sbin" /usr/bin/pihole flush once quiet
. Command called from/etc/cron.d/pihole
.Problem is that neither
/etc/pihole/logrotate
no/var/log/pihole.log
file does not exists. But/etc/logrotate.d/pihole
and/var/log/pihole-FTL.log
file exists.Please, make modifications:
/etc/cron.d/pihole
: to correctly find logrotate file at/etc/logrotate.d/pihole
path;/usr/bin/pihole
: to create/var/log/pihole.log
file, if this file needs (test command ispihole flush once quiet
).