-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Improve FTL startup detection and log tailing #1940
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
Conversation
…ng FTL. We will use this as a starting point to: - Check that FTL has started when grepping for the "FTL Started" string - Position to start tailing from when streaming the log file We wait for a maximum of 30 seconds for FTL to start, else we exit the container Co-authored-by: yubiuser <github@yubiuser.dev> Co-authored-by: casperklein <casperklein@users.noreply.github.com> Signed-off-by: Adam Warner <me@adamwarner.co.uk>
rdwebdesign
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is working as expected.
|
Is this for a new container with a new and empty volume or for updated containers with a previously used volume? |
|
Little from column a), little from column b). It takes into account:
|
++ getFTLConfigValue files.log.ftl
++ pihole-FTL --config -q files.log.ftl
+ FTLlogFile=/var/log/pihole/FTL.log
+ local startFrom
++ stat -c%s /var/log/pihole/FTL.log
+ startFrom=7050
+ echo ' [i] Starting pihole-FTL (no-daemon) as pihole'
[i] Starting pihole-FTL (no-daemon) as pihole
+ echo ''
+ CAPSH_PID=413
+ capsh --user=pihole --keep=1 -- -c '/usr/bin/pihole-FTL no-daemon >/dev/null'
+ + timeout 30 grep tail -q -F -c +7051 -- /var/log/pihole/FTL.log
'########## FTL started'
2025-11-06 19:21:17.808 UTC [416M] INFO: ########## FTL started on 5bd113d534f7! ##########Looks like it does what it says. I'm not sure how to test the 30 second timeout failure though? |
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net> Signed-off-by: Adam Warner <me@adamwarner.co.uk>

What does this PR aim to accomplish?:
This PR take a little logic from #1932, and a little from #1934
Both are good ideas, but I want to combine and tweak them a little. For example, I do not want to use the
pihole-FTL wait-forcommand, as it does not quite suit the purpose we are looking for, but I do want to exit the container if FTL has not started within 30 seconds - else it will just hang.I also like the idea of reading the FTL log filesize on container start, and then basing all interaction with the log file from that point onwards.
By submitting this pull request, I confirm the following:
git rebase)