Closed shunf4 closed 3 months ago
On a traditional UNIX system the children of an exited parent would be reassigned to PID 1. On my modern Linux system with systemd they get reassigned to some process that seems to act as PID 1 for my session.
Windows is, of course, different. Your process 23508 has exited, so it doesn't itself appear in the output of ps
, but its children still hold references to it as their parent.
Those references aren't very useful, as there's not much you can do with an exited process. Reporting a fake PID 1 as the parent in such cases would be more consistent with how similar UNIX-like features are handled in busybox-w32.
The issue with kill -0
still seeing the exited process is a bug.
Expect fixes in due course.
OK, orphaned processes now have a parent PID of 1 and kill
fails for processes that have exited.
Try the latest prerelease (PRE-5344 or above).
Running this script with
busybox ash
:shows:
Now PID 23508 should have already exited.
But
busybox ps
still sees it, not as an actual process, but as other processes' parent:And detecting the process by
kill -0
succeeds:This seems not typical behaviour of UNIX-like processes. Is this working as intended or acceptable? Thanks.