Closed dallenwilson closed 1 year ago
Can you make a PR for a fix? I think the fix would be like:
{ [ -e /var/lib/pihole/gravity.db ] &&
[ -e /var/lib/pihole/pihole-FTL.db ]; } &&
checkpath -m 0664 -f \
/var/lib/pihole/gravity.db \
/var/lib/pihole/pihole-FTL.db || ewarn "gravity.db or pihole-FTL.db is not properly installed"
Better idea, check the size:
{ [ -s /var/lib/pihole/gravity.db ] &&
[ -s /var/lib/pihole/pihole-FTL.db ]; } &&
checkpath -m 0664 -f \
/var/lib/pihole/gravity.db \
/var/lib/pihole/pihole-FTL.db || ewarn "gravity.db or pihole-FTL.db is not properly installed"
On a fresh install of gentoo and pihole/pihole-FTL, I found that the
pihole-FTL.db
remained empty and unused, the only errors logged were regarding missing database tables. Eventually I found the cause:The OpenRC init script installed by the ebuild at
/etc/init.d/pihole-FTL
performs several sanity-checks before launching the pihole-FTL daemon. The last check uses thecheckpath
command to verify that/var/lib/pihole/pihole-FTL.db
has the correct file permissions. This is the source of the problem.checkpath
test on a file fails because the file does not exist, it creates the (empty) file.The result of those three items is that launching pihole-FTL on a new install properly via rc-service leads to a situation where
pihole-FTL.db
is unusable.I ran
rc-service pihole-FTL stop
, deleted/var/lib/pihole/pihole-FTL.db
, commented out the last sanity check in/etc/init.d/pihole-FTL
, and started it again withrc-service pihole-FTL start
and the database was created, initialized and used correctly after that.