Fix multiple restarts while importing with Teleporter #2519
+10
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR aim to accomplish?:
Do not restart FTL for each local DNS record or local CNAME record. This was partly fixed by #1925 but re-introduced with #2410.
Background: we use
addCustomDNSEntry
andaddCustomCNAMEEntry
when adding domains through the web interface but also via Teleporter. We don't want a reload for each added item, but a restart when added via web but not via Teleporter. Teleporter is handling restarts by itself because it only restarts when everything is imported.So far, this bug was hiding, but with adding a native
systemd
unit and setting a start limit of 5 within 60 seconds this unveiled the bug.https://github.com/pi-hole/pi-hole/blob/c7ad7113d70f63b0b4a5460daaf5ada8f10c28f4/advanced/Templates/pihole-FTL.systemd#L14-L16
How does this PR accomplish the above?:
Adds a new variable
$teleporter
to the function to signal if it was called fromteleporter.php
.By submitting this pull request, I confirm the following:
git rebase
)