headplane icon indicating copy to clipboard operation
headplane copied to clipboard

Proc mode: try to guess PID based on Parent PID when multiple found

Open hayer opened this issue 6 months ago • 1 comments
trafficstars

Headplane seems to have problem when there are multiple PIDs that has the same cmdline. The correct PID is the one with Parent PID 1 which is the one spawned by systemd.

This is not always the case, but I see this as a better solution than erroring out if count > 1.

hayer avatar May 20 '25 18:05 hayer

I'm open to this change, but what are the consequences of the bad case, where the PID is not correctly found based on the PID 1 heuristic?

tale avatar May 21 '25 15:05 tale

If it finds no PID with Parent PID 1 it fails like it did before.

If it finds one and that is somehow the wrong one it won't work. Its the assumption that if it is spawned by PID 1, aka "init", it is the root one.

hayer avatar May 26 '25 02:05 hayer

Sounds good, will merge this in for the 0.6.1 candidate.

tale avatar May 26 '25 11:05 tale

As one of the people hit by this, I'm interested in trying out 6.1 one this is merged in 🙂.

tecosaur avatar Jun 21 '25 18:06 tecosaur

I'm going to merge this in and do a formatting pass on it.

tale avatar Jun 22 '25 21:06 tale