Skip to content
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

Use getFTLPID instead of pidof #313

Merged
merged 4 commits into from
Dec 29, 2022
Merged

Use getFTLPID instead of pidof #313

merged 4 commits into from
Dec 29, 2022

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Dec 24, 2022

What does this PR aim to accomplish?:

Currently, we use pidof to test if FTL is running. However, there are hints that pidof might be a bit unreliable to find all processes. See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926896 and https://unix.stackexchange.com/questions/518411/why-is-pidof-not-working

This as also been reported in one of our issues: #307 (comment)

How does this PR accomplish the above?:

  1. Replacing pidof with getFTLPID, a function that we also use in core. It'll read the PID from pihole-FTL.pid file FTL writes on it's start.
  2. Additionally, this PR adds the h option to the ps command for getting FTLs CPU and memory utilization to save one pipe to tail.

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 and I have tested my changes.
  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)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

@yubiuser yubiuser mentioned this pull request Dec 24, 2022
@yubiuser yubiuser marked this pull request as ready for review December 26, 2022 16:48
@yubiuser yubiuser requested a review from a team December 26, 2022 16:48
@yubiuser yubiuser changed the title Use ps instead of pidof Use getFTLPID instead of pidof Dec 26, 2022
padd.sh Outdated Show resolved Hide resolved
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link

Conflicts have been resolved.

Signed-off-by: Christian König <[email protected]>
Signed-off-by: Christian König <[email protected]>
Signed-off-by: Christian König <[email protected]>
rdwebdesign
rdwebdesign previously approved these changes Dec 28, 2022
@yubiuser
Copy link
Member Author

Added a small visual improvement.

@yubiuser yubiuser merged commit 30dabe5 into development Dec 29, 2022
@yubiuser yubiuser deleted the ps branch December 29, 2022 07:19
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.

3 participants