-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service "pihole-FTL" keeps crashing/stopping; both as HW on RPi 2 Mod B+ & as VM #614
Comments
Extra details Cross-posted at DietPi GitHub as Issue# 2976. HW and VM details above/beyond the above are listed. |
Do you have a log of the crash, either from |
And that's another thing ... it never seems to leave an error message in the logs. See here: This is the closest I've ever come to a log file that at least shows the entries leading-up to the event: |
@kuerious @Mcat12 One idea is that it is due to DietPi-RAMlog, respectively DietPi-Logclear which removes non-today Pi-hole log entries when the files fill half of available tmpfs size. After the logs are truncated, pihole-FTL is restarted in a special way that did work and was required some earlier times, but perhaps it does not anymore in some cases: https://github.com/MichaIng/DietPi/blob/master/dietpi/func/dietpi-logclear#L164-L177
I will also run some tests later and try to replicate the issue. |
I don't think it is. I never did it myself.
I don't think you need to restart
or something similar to avoid or at least reduce uncertainties if the log is really empty or was flushed at some point. Probably even with a time stamp.
We have signal handlers that should catch and report every crash or termination request. The only thing we can not catch and log is an immediate termination via |
Okay I think stopping it before touching the files still makes sense to avoid the rare change that both touch the logs the same time? Although it was never an issue with other logs where it could basically be the same, if not concurrent accesses are handled kernel-wise. However I think there is a difference between "opening" and "closing" a file, so "occupying" it and doing a single write, AFAIK.
Very good idea, will add this. @kuerious Ah now I see something:
|
I do not yet see the real difference than just truncating the file. The worst thing that could happen would be a cropped log line. We do not write to the file when it cannot be opened and when we opened it, you should not be able to delete it: the file might disappear on the file system but our handle stays open and we can write to the file. In contrast, (re)starting
Yeah, it's different for |
Okay so Anyway I have to spin up a test install to go through all of this, hopefully with a solution for clearing pihole.log without doing a pihole-FTL restart. One idea was to not have it in RAMlog, but instead in the userdata dir that most users move to external drive (hopefully), then leaving a symlink in /var/log/. Clearing logs can skip symlinks of course as long as their destination is outside the tmpfs.
It's |
You can find what is blocking a domain by using The only current usages of |
Okay I just checked things now:
So indeed pihole.log could/should be disabled without any disadvantage for regular users. I used:
So basically a little cleanup and clear separation of these two logging systems would be helpful, and yeah, disabling pihole.log by default totally makes sense 👍. For DietPi I will now implement the following after Pi-hole installer has finished:
@DL6ER Additionally I will remove the special pihole.log handling from our logclear script. Even if enabled, I could not force any error by clearing the file. Furthermore the pihole-FTL restart, when file has grown over limit, seems to break in cases (in combination with resolvconf restart?) and as @Mcat12 mentioned is a large overhead as well. |
+ DietPi-Software | Pi-hole: Disable pihole.log by default: pi-hole/FTL#614 (comment) + DietPi-Software | Pi-hole: Add Pi-hole specific Lighttpd include config based on: https://github.com/pi-hole/pi-hole/blob/master/advanced/lighttpd.conf.debian + DietPi-Software | Lighttpd: Do not create lighttpd.conf backup, since we only edit webroot or fix a Buster upgrade bug, which both is simply required and expected by user to have the just chosen software title + Lighttpd up and running. + DietPi-Logclear | Remove special pihole.log handling, which is not required since clearing it does not break the service/process anymore and query logs are holt in database. Also pihole.log is disabled now by default on our Pi-hole installs. + DietPi-Logclear | Remove log file exclusion code fragments, which was never really implemented + DietPi-Logclear | Further coding enhancements + DietPi-Cleaner | Never remove Git, since it is required often for internal updaters, e.g. Pi-hole + DietPi-Cleaner | Fix /var/tmp/dietpi/logs/dietpi-ramlog_store removal and use new DietPi-Set_software apt-cache function to clean APT + DietPi-Cleaner | Minor coding
I, too, have done the above:
It seems to have cleared the queries logged up to this point (in the daily/24-hour period), which I find strange, see here: I will keep an eye on things and report back anything of interest. |
Jep exactly as I mentioned above, a bid strange it is. However this is just a single time and the query logs (in database) continue as before, as wanted. |
Well, it's been a few hours, and the graphs all seem to be happy: https://i.imgur.com/xEpTEdG.png No need for a reboot in awhile. Now, mind you, this is the VM I used with the x86_64 DietPi image. I set the specs to be 4x cores, 4GB memory, and 8GB storage. This is geared more towards the new RPi 4, not the lower-end RPi devices. Should I drop the memory to see if things happen? Or will it not matter? |
The Previously, before FTL v4, we read from the dnsmasq log in order to get the query information. Now that we run dnsmasq as part of FTL, we read the queries directly from dnsmasq and no longer need the log. |
The service recreates the log file on start anyway, so no point in removing it. Btw also the dir /var/log/pihole is created but not in use with default setup? @kuerious |
|
Solved by DietPi 6.26.0 |
In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:
How familiar are you with the codebase?:
6....ish
[BUG | ISSUE] Expected Behaviour:
Running latest pull of DietPi, installing "Pi-hole", runs 24hrs/day, 7 days per week, without crashing.
[BUG | ISSUE] Actual Behaviour:
A minimum of 1x/day, sometimes up to 3x/day, the service/process "pihole-FTL" crashes without (apparent) log entries as to why.
[BUG | ISSUE] Steps to reproduce:
Installed latest version of
Log file output [if available]
Token File here
Device specifics
1st Attempt:
Hardware Type: rPi 2 Model B+, 8GB microSD
OS: DietPi (Stretch + security updates)
2nd Attempt:
Hardware Type: VM w/ 4x core, 4GB RAM, 8GB space allocated
OS: DietPi (Stretch + security updates)
This template was created based on the work of
udemy-dl
.The text was updated successfully, but these errors were encountered: