Skip to content

Improve already running detection#2591

Merged
DL6ER merged 1 commit intodevelopmentfrom
tweak/procps_check_name
Aug 4, 2025
Merged

Improve already running detection#2591
DL6ER merged 1 commit intodevelopmentfrom
tweak/procps_check_name

Conversation

@DL6ER
Copy link
Copy Markdown
Member

@DL6ER DL6ER commented Aug 4, 2025

What does this implement/fix?

Also check name of process identified by PID file when trying to identify if FTL is already running to resolve a rare edge-case with reboot-persistent PID files and PID collisions. So far, this error has only been observed in certain docker configurations that lack the mandated PID file deletion after process shutdown

With this new check, nothing changes in the "normal" case:

2025-08-03 21:18:38.846 CEST [2803950M] CRIT: pihole-FTL is already running (PID 1400358)!

However, if the PID actually belong to a different process (see described rare edge-case above), FTL does now not (incorrectly) stop any longer but merely logs

2025-08-03 21:18:05.180 CEST [2803601M] WARNING: Found process "grep" at PID 1400357 suggested by PID file, ignoring

This PR has been sparked by pi-hole/docker-pi-hole#1789 (comment)


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:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories development branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

…tify if FTL is already running to resolve a rare edge-case with reboot-persistent PID files and PID collisions. So far, this error has only been observed in certain docker configurations that lack the mandated PID file deletion after process shutdown

With this new check, nothing changes in the "normal" case:
```
2025-08-03 21:18:38.846 CEST [2803950M] INFO: pihole-FTL is already running (PID 1400358)!
```

However, if the PID actually belong to a different process (see described rare edge-case above), FTL does now not (incorrectly) stop any longer but merely logs
```
2025-08-03 21:18:05.180 CEST [2803601M] WARNING: Found process "grep" at PID 1400357 suggested by PID file, ignoring
```

Signed-off-by: DL6ER <[email protected]>
@DL6ER DL6ER merged commit c41c757 into development Aug 4, 2025
17 checks passed
@DL6ER DL6ER deleted the tweak/procps_check_name branch August 4, 2025 17:47
@PromoFaux PromoFaux mentioned this pull request Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants