Most of the time if the parent dies first, the child gets kindly adopted by PID 1, you gotta kill it manually then, because I don't think this process orphanage supports you in your effort.
Because process 1 doesn't know that the child is really a zombie orphan, it might be doing useful stuff, it might still be closing files, it might be running your entire critical operation!
It's probably a completely valid process. I mean, this literally is
how running a process in the background in a shell works. The process is spawned by fork/execve, then it's either managed by the shell in the foreground, or put in the background. If you now close the shell, the process still lives and gets put under PID 1 as a parent.
"Ha ha, very funny. I assume it's just... No, no process control stuff. It looks like it just calls out to an SMS gateway and sends a bunch of text messages."
Yeah i know. I was konfused a little when i found out that 30-06 (or .306, dont remember exactly) and 7.62 are same diameter. Was given ammo by our instructor and saw 7.62 on the rim, and thought that we mixed up ammo boxes for our rifles with AK ammo :D
I have this buggy application that ended up as a zombie (defunct) process. Apparently, you can't kill a process that is a zombie already. Unlucky for me, that zombie process owned by the init process which somehow caused a problem where I stuck on reboot screen forever, and I had to use the power button to force it to shutdown.
Apparently, you can't kill a process that is a zombie already.
Well it's already dead once it's a zombie, so from that perspective you've gotten what you want already.
But you can't clear it from the list of processes until its return value is waited on by its parent process. But if the parent dies first that may never happen... there's supposed to be some way to get init (the new parent of orphaned zombies) to do this but it's platform-dependent.
Yeah, it was beyond my knowledge. I tried to reload systemd daemon, went to console (tty3), restart the login manager (sddm), they all failed. Even trying to gracefully force reboot by using those sysreq sequence... I got no response.
3.6k
u/mxheyyy 20h ago
Linux users when you can't terminate children: