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 implement/fix?
So far, FTL tried to prevent multiple processes from being started on the same machine. However, as the
pihole-FTL
binary became kind of a Swiss-army-knife offering integrated features such assqlite3
,sqlite3_rsync
,sha256sum
,gzip
,lua
,dhcp-discover
, and others (like a small TLS certificate managing toolset), it becomes more and more likely that there are long-lived interactivepihole-FTL
instances on the machine. They may coexist without any issues, however, once such an interactive process is running, restarting the originalpihole-FTL
may be prevented under certain circumstances.Hence, I propose going a different, much easier path: Allow parallel processes to coexist peacefully much like most other daemons do. Duplicate processes will in the end not be able to fully start up as they cannot acquire the DNS and webserver ports. However, the currently possible situation of not being able to restart the main DNS-providing process is resolved hereby.
We allow the new parallelism by ensuring uniqueness of the shard memory objects by changing their name to include the main PID of each FTL process, e.g.,
FTL-34532-clients
instead of (right now) the shorterFTL-clients
.No change to the
post-stop
command is needed as the deletion glob still matches the tweaked names:Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.