Suggested systemd service file to insure pihole.db is populated with data if DBINTERVAL= is non-default

You can find the differences here: https://raw.githubusercontent.com/max72bra/pi-hole-ftl-archlinux-customization/master/arch-ftl-5.25.2-1.patch

After those are applied, pi-hole-FTL is built like this: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pi-hole-ftl#n42

Finally, the package is created starting here: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pi-hole-ftl#n49

Ah, yeah. I'm constantly getting confused with v5/v6 of Pi-hole being discussed, sorry for that. The pihole.log file path is not controlled by pihole-FTL in v5.x and this seems to be missing on the Arch Linux deployment (at least from the fragments I have seen).

However, you will be able to change all default paths in v6 from this file.

Replying to myself here: Yes, if the pihole.log log file cannot be created, the embedded dnsmasq core inside pihole-FTL goes into some kind of meta-failed-mode where it shouldn't be doing anything actually (i.e. not responding to DNS requests, either). I think we should improve on this and just created a PR (targeting the v6.0 beta) for this:

For v5.0, you should be able to apply the same fix by ensuring the log file exists (presumably configured in /etc/dnsmasq.d/01-pihole.conf). If this file is missing (almost looks like this from the AUR Package site), not much will work anyway.

Bottom line: Glad we found the difference and at least for Pi-hole v6.0, the PR avoids the process becoming un-terminate-able.

1 Like

Arch does have both log files but they have been moved. See the patch I referenced several posts above. Here is the relevant section:

diff -uprN FTL-5.25.2/src/config.c FTL-5.25.2.cust/src/config.c
--- FTL-5.25.2/src/config.c     2024-05-08 21:59:50.000000000 +0200
+++ FTL-5.25.2.cust/src/config.c        2024-05-09 13:51:35.638439266 +0200
@@ -76,7 +76,7 @@ void getLogFilePath(void)
        }
 
        // Read LOGFILE value if available
-       // defaults to: "/var/log/pihole/FTL.log"
+       // defaults to: "/run/log/pihole-ftl/pihole-FTL.log"
        buffer = parse_FTLconf(fp, "LOGFILE");
 
        errno = 0;
@@ -84,7 +84,7 @@ void getLogFilePath(void)
        if(buffer == NULL || sscanf(buffer, "%127ms", &FTLfiles.log) != 1)
        {
                // Use standard path if no custom path was obtained from the config file
-               FTLfiles.log = strdup("/var/log/pihole/FTL.log");
+               FTLfiles.log = strdup("/run/log/pihole-ftl/pihole-FTL.log");
        }
 
        // Test if memory allocation was successful

I can confirm having both log files on the machine exhibiting the bug.

I don't see how this patch moves the file we're taking about: /var/log/pihole/pihole.log

My bad, the Arch package for pi-hole as well as for pi-hole-FTL have been modified. It seems that the mods to pi-hole shown below are what is doing it. I am 100% sure that I have /run/log/pihole/pihole.log as a result.

See these two patches:
arch-server-core-5.18.3-1.patch
arch-server-admin-5.21-1.patch

Anf for the record, the PKGBUILD itself.

Looking at the patches you linked here, it seems Arch missed the most important spot exactly causing what we've seen throughout this journey:

I have that in /etc/dnsmasq.d/01-pihole.conf:

% grep log-fac /etc/dnsmasq.d/01-pihole.conf
log-facility=/run/log/pihole/pihole.log

It is included in dnsmasq.include which is installed to the package as /etc/dnsmasq.d/01-pihole.conf, see line 100 in the PKGBUILD:

install -Dm644 dnsmasq.include "$pkgdir"/etc/dnsmasq.d/01-pihole.conf

Then I really don't know (again) what the difference under Arch Linux is that is causing FTL to behave like this. TBH, it is quite inconvenient and confusing to try to debug based on reading diffs alone and the project scattered into so many individual packages in an environment I'm not familiar with. It seems there's always something I'm missing.

My suggestion at this point would maybe rather be focusing on bringing the AUR package up to speed with the development-v6 branches which are soon expected to become development and then (hopefully?) be released as Pi-hole v6.0 later this year. We already know from our tests above that SIGTERM does work here as expected.

Thanks for the engagement on this @DL6ER