Getting processess_by_name
for the name of the running process returns duplicated processes
#1449
Labels
processess_by_name
for the name of the running process returns duplicated processes
#1449
Describe the bug
I want to use this library to see if my daemon is already running, so I tried to just search for a process with the name
netpulsed
. This searching is done by a different part of thenetpulsed
executable. That way, instead of finding the expected two processes (my actual running daemon if it runs and the setup process), it somehow finds 18 processes!To look more into this, I wrote a tiny process list with this library. It works pretty well by itself, but if you search for programs with the same name as the executed binary, it shows many strange processes. Is it perhaps a strange implementation detail that forks to get the processes?
This on a GNU/Linux system:
Linux theseus 6.9.3-76060903-generic #202405300957~1732141768~22.04~f2697e1 SMP PREEMPT_DYNAMIC Wed N x86_64 x86_64 x86_64 GNU/Linux
To Reproduce
Trivial example:
Output:
The text was updated successfully, but these errors were encountered: