I had over a 1000 PIDs on one of my servers that were zombies children of a weechat process someone was running.
I didn't want to kill their weechat, but I still wanted the zombies gone. So I sent the weechat a SIGCHLD just in case that'd trigger a cleanup wait() in it.
It did not.
Next attempt was to attach to the parent process and call the wait() function myself.
$ gdb weechat 12345 [...] (gdb) call wait(0) $1 = 12346 (gdb) $2 = 12347 [spam enter until all 1000 children are reaped] (gdb) $1001 = -1 (gdb) quit
In the middle I accidentally did the "continue" command instead of quit and had to figure out how to get gdb to go back to its prompt.
Turns out it is as simple as sending a SIGINT (2) to the process and gdb catches it and goes back to the prompt.
text/gemini
This content has been proxied by September (ba2dc).